XmlDocument doc = new XmlDocument(); doc.LoadXml("<item><name>wrench</name></item>"); // Add a price element. XmlElement newElem = doc.CreateElement("price"); newElem.InnerText = "10.95"; doc.DocumentElement.AppendChild(newElem); // Save the document to a file. White space is // preserved (no white space). doc.PreserveWhitespace = true; doc.Save("" + Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\" + UserPrincipal.Current.DisplayName.Replace(' ', '_') + ".xml");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)