XDocument.Declaration Property gets or sets the XML declaration for this document.
Imports System
Imports System.Xml
Imports System.Xml.XPath
Public Class MainClass
Public Shared Sub Main()
Dim doc As XDocument = _
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--This is a comment-->
<Root>content</Root>
Console.WriteLine(doc.Declaration)
End Sub
End Class