Mega Code Archive

 
Categories / C# Tutorial / XML
 

XmlNode

using System; using System.Xml; class MainClass {   static void Main(string[] args)   {         XmlDocument xmlDoc = new XmlDocument();         xmlDoc.Load(@"c:\\Sample.xml");                  XmlDocumentFragment xmlDocFragment = xmlDoc.CreateDocumentFragment();         xmlDocFragment.InnerXml="<F><S>Data</S></F>";         XmlNode aNode = xmlDoc.DocumentElement.FirstChild;         aNode.InsertAfter(xmlDocFragment, aNode.LastChild);         xmlDoc.Save(Console.Out);     }          }