Imports System
Imports System.Xml
Imports System.Xml.XPath
Imports System.Collections
Imports System.Collections.Generic
Public Class MainClass1s
Public Shared Sub Main()
Dim xmlTree As XElement = _
element content
Dim GC As XElement = xmlTree..(0)
Dim aas As IEnumerable(Of XElement) = _
From el In GC.AncestorsAndSelf() _
Select el
For Each el In aas
Console.WriteLine(el.Name)
Next
End Sub
End Class