Mega Code Archive
Inserts the specified node immediately after the specified reference node
using System;
using System.IO;
using System.Xml;
public class Sample {
public static void Main() {
XmlDocument doc = new XmlDocument();
doc.LoadXml("" +
"C#" +
"");
XmlNode root = doc.DocumentElement;
XmlElement elem = doc.CreateElement("price");
elem.InnerText="9.9";
root.InsertAfter(elem, root.FirstChild);
doc.Save(Console.Out);
}
}