CSharp examples for System.Xml:XML Document
Create Document from root name
using System.Xml; using System.IO;//w w w .ja v a 2 s . c o m public class Main{ public static XmlElement CreateDocument(string rootName) { XmlDocument doc = new XmlDocument(); XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", null, null); doc.AppendChild(dec); XmlElement root = doc.CreateElement(rootName); doc.AppendChild(root); return root; } }