XmlNodeType nodeType = XmlNodeType.Element; string nodeTypeStr = nodeType.ToString(); // nodeTypeStr will now be "Element"
XmlNode node = xmlDoc.SelectSingleNode("/root/element"); string nodeTypeStr = node.NodeType.ToString(); // nodeTypeStr will now be "Element"This example demonstrates how to get the node type of an XmlNode object and convert it to its corresponding string representation using the ToString method. Package library: This method is a member of the System.Xml.dll library, which is part of the .NET Framework and is included with Visual Studio.