Add an element to XML document in C#.NET



Add an element to XML document

// dll: System.Xml
using System.Xml;
public static void AddElement(string Element, string Value)   
{
XmlDocument XmlDoc = new XmlDocument();
XmlNode newElement;
newElement = XmlDoc.CreateElement(Element)
newElement.InnerText = Value;
XmlDoc.AppendChild(newElement) ;
}

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.