CSharp examples for System.Xml:XML Node
Add XML Node
using System.Xml; public class Main{ public static XmlNode AddNode(XmlNode parent, string name, string value = null) {/* w ww .j a v a 2s.c o m*/ if (parent == null || string.IsNullOrEmpty(name)) return null; XmlElement element = parent.OwnerDocument.CreateElement(name); if (!string.IsNullOrEmpty(value)) { XmlText text = parent.OwnerDocument.CreateTextNode(value); element.AppendChild(text); } return parent.AppendChild(element); } }