I have a large xml file (approx. 10 MB) in following simple structure:
.......
.......
Try this out:
var doc = new XmlDocument();
doc.LoadXml("This is my first error ");
XmlNode root = doc.DocumentElement;
//Create a new node.
XmlElement elem = doc.CreateElement("error");
elem.InnerText = "This is my error";
//Add the node to the document.
if (root != null) root.AppendChild(elem);
doc.Save(Console.Out);
Console.ReadLine();