Display the name of the root element in the loaded XML tree
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