Get the DTD of the document.
The DTD of the document, or null if the document has no DTD.
The root element of the document. If the document is newly created and hasn’t been set up with a root, an XmlError will be thrown.
Set the root element of the document.
The new root. If the node is from another document, it and its subtree will be removed from the previous document.
Dispose the object.
It releases the managed resource and unregisters it from FinalizationRegistry. This ensures that the release of the managed resource doesn't have to wait until the object is garbage collected.
To avoid resource leaks,
explicitly call the Dispose method or use the using declaration to declare the object.
Create the root element.
The name of the root element.
Optionalnamespace: stringThe namespace of the root element.
Optionalprefix: stringThe prefix of the root node that represents the given namespace. If not provided, the given namespace will be the default.
Evaluate the given XPath selector on the root element.
XPath selector
Optionalnamespaces: NamespaceMapFind all the descendant nodes of root element matching the given xpath selector.
XPath selector
Optionalnamespaces: NamespaceMapmapping between prefix and the namespace URI, used in the XPath
An empty array if no nodes are found.
Find the first descendant node of root element matching the given xpath selector.
XPath selector
Optionalnamespaces: NamespaceMapmapping between prefix and the namespace URI, used in the XPath
null if not found, otherwise an instance of the subclass of XmlNode.
Process the XInclude directives in the document synchronously.
the number of XInclude nodes processed.
Save the XmlDocument to a buffer and invoke the callbacks to process.
handlers to process the content in the buffer
Optionaloptions: SaveOptionsoptions to adjust the saving behavior
Save the XmlDocument to a buffer and invoke the callbacks to process.
Optionaloptions: SaveOptionsSave the XmlDocument to a string
Optionaloptions: SaveOptionsoptions to adjust the saving behavior
StaticcreateCreate a new document from scratch. To parse an existing xml, use fromBuffer or fromString.
StaticfromParse and create an XmlDocument from an XML buffer.
The XML buffer
Parsing options
StaticfromParse and create an XmlDocument from an XML string.
The XML string
The XML document.