Mega Code Archive

 
Categories / C# / XML LINQ
 

XDocument NodeType Property returns the node type for this node

using System; using System.IO; using System.Linq; using System.Xml.Linq; using System.Xml; using System.Collections; using System.Collections.Generic; public class MainClass {     public static void Main()     {         XDocument xmlTree = new XDocument(             new XDeclaration("1.0", "utf-8", "yes"),             new XElement("Root", "content")         );         Console.WriteLine(xmlTree.NodeType);     } }