CSharp examples for System.Xml:XML Element
Add XML Text Element
using System.Xml; public class Main{ public static void AddTextElement(this XmlElement elem, string newElemName, string text) {// w ww. j a v a 2 s . c o m XmlElement newElem = elem.OwnerDocument.CreateElement(newElemName); newElem.InnerText = text; elem.AppendChild(newElem); } }