Using LINQ to XML, you can do this:
XDocument doc = XDocument.Load("input.xml"); string rootLocalName = doc.Root.Name.LocalName; textBox1.Text = '<' + rootLocalName + '>';
With an XmlDocument, you can use this:
XmlDocument doc = new XmlDocument(); doc.Load("input.xml"); string rootName = doc.SelectSingleNode("/*").Name;
Mark byers
source share