CSharp examples for System.Xml:XML Node
Add New XML Node
using System.Text.RegularExpressions; using System.Xml; using System.Text; using System.Linq; using System.Collections.Generic; using System;/* w w w . java 2 s.c o m*/ public class Main{ public static XmlNode AddNewNode(XmlNode fathernode, string name, string content) { XmlDocument xdoc = fathernode.OwnerDocument; XmlNode snode = xdoc.CreateElement(name); if (!String.IsNullOrEmpty(content)) { snode.InnerXml = ReplaceInvalidChar(content); } fathernode.AppendChild(snode); return snode; } }