IXMLDocument exclude xml declaration

I am trying to get XML text from an IXMLDocument, for example:

Doc.XML.Text; 

This gives me the XML text, but includes an xml declaration.

 <?xml version="1.0"?> 

Is there any way to get the XML text excluding the xml declaration. I could always remove it manually from the result of the string, but I feel there must be a property or something that I can set in the document to exclude the xml declaration.

Example

Doc.XML.Text Output

 <?xml version="1.0"?> <Certificates> <Certificate> </Certificate> </Certificates> 
+6
source share
1 answer

You can read it from the DocumentElement.XML property. The DocumentElement property provides access to the root file of the XML document node and XML returns the XML content of the node.

+7
source

All Articles