LocalName returns the name of the element as a string
Imports System
Imports System.Xml.Linq
Public Class MainClass
Public Shared Sub Main()
Dim xmlDoc As XDocument = XDocument.Load("Employees.xml")
Console.WriteLine("The document declaration is '{0}'", xmlDoc.Declaration.ToString)
Console.WriteLine("The root element is '{0}'", xmlDoc.Root.Name.LocalName)
End Sub
End Class
Related examples in the same category