XObject.Document Property gets the XDocument for this XObject.
Imports System
Imports System.Xml
Imports System.Xml.Schema
Class MainClass
Shared Sub Main()
Dim doc As XDocument = _
<?xml version="1.0"?>
<!--A comment in the document.-->
<Root>
<Child>content</Child>
</Root>
Dim child As XElement = doc.Descendants("Child").First()
Dim documentOfChild As XDocument = child.Document
Console.WriteLine(documentOfChild.FirstNode)
End Sub
End Class