<PackageReference Include="System.Xml.XmlDocument" Version="4.0.1-beta-23409" />

XmlDocument

public class XmlDocument : XmlNode
Represents an XML document.For more information, see the Remarks section.
public XmlElement DocumentElement { get; }

Gets the root XmlElement for the document.

Gets the XmlImplementation object for the current document.

public XmlNameTable NameTable { get; }

Gets the XmlNameTable associated with this implementation.

public bool PreserveWhitespace { get; set; }

Gets or sets a value indicating whether to preserve white space in element content.

Occurs when the Value of a node belonging to this document has been changed.

Occurs when the Value of a node belonging to this document is about to be changed.

Occurs when a node belonging to this document has been inserted into another node.

Occurs when a node belonging to this document is about to be inserted into another node.

Occurs when a node belonging to this document has been removed from its parent.

Occurs when a node belonging to this document is about to be removed from the document.

public XmlDocument()

Initializes a new instance of the XmlDocument class.

Initializes a new instance of the XmlDocument class with the specified XmlNameTable.

public XmlAttribute CreateAttribute(string name)

Creates an XmlAttribute with the specified Name.

public XmlAttribute CreateAttribute(string qualifiedName, string namespaceURI)

Creates an XmlAttribute with the specified qualified name and NamespaceURI.

public virtual XmlAttribute CreateAttribute(string prefix, string localName, string namespaceURI)

Creates an XmlAttribute with the specified Prefix, LocalName, and NamespaceURI.

public virtual XmlCDataSection CreateCDataSection(string data)

Creates an XmlCDataSection containing the specified data.

public virtual XmlComment CreateComment(string data)

Creates an XmlComment containing the specified data.

Creates an XmlDocumentFragment.

public XmlElement CreateElement(string name)

Creates an element with the specified name.

public XmlElement CreateElement(string qualifiedName, string namespaceURI)

Creates an XmlElement with the qualified name and NamespaceURI.

public virtual XmlElement CreateElement(string prefix, string localName, string namespaceURI)

Creates an element with the specified Prefix, LocalName, and NamespaceURI.

public virtual XmlNode CreateNode(XmlNodeType type, string prefix, string name, string namespaceURI)

Creates a XmlNode with the specified XmlNodeType, Prefix, Name, and NamespaceURI.

public virtual XmlNode CreateNode(string nodeTypeString, string name, string namespaceURI)

Creates an XmlNode with the specified node type, Name, and NamespaceURI.

public virtual XmlNode CreateNode(XmlNodeType type, string name, string namespaceURI)

Creates an XmlNode with the specified XmlNodeType, Name, and NamespaceURI.

public virtual XmlProcessingInstruction CreateProcessingInstruction(string target, string data)

Creates an XmlProcessingInstruction with the specified name and data.

Creates an XmlSignificantWhitespace node.

public virtual XmlText CreateTextNode(string text)

Creates an XmlText with the specified text.

public virtual XmlWhitespace CreateWhitespace(string text)

Creates an XmlWhitespace node.

public virtual XmlDeclaration CreateXmlDeclaration(string version, string encoding, string standalone)

Creates an XmlDeclaration node with the specified values.

public virtual XmlNodeList GetElementsByTagName(string name)

Returns an XmlNodeList containing a list of all descendant elements that match the specified Name.

public virtual XmlNodeList GetElementsByTagName(string localName, string namespaceURI)

Returns an XmlNodeList containing a list of all descendant elements that match the specified LocalName and NamespaceURI.

public virtual XmlNode ImportNode(XmlNode node, bool deep)

Imports a node from another document to the current document.

public virtual void Load(Stream inStream)

Loads the XML document from the specified stream.

public virtual void Load(TextReader txtReader)

Loads the XML document from the specified TextReader.

public virtual void Load(XmlReader reader)

Loads the XML document from the specified XmlReader.

public virtual void LoadXml(string xml)

Loads the XML document from the specified string.

public virtual XmlNode ReadNode(XmlReader reader)

Creates an XmlNode object based on the information in the XmlReader. The reader must be positioned on a node or attribute.

public virtual void Save(Stream outStream)

Saves the XML document to the specified stream.

public virtual void Save(TextWriter writer)

Saves the XML document to the specified TextWriter.

public virtual void Save(XmlWriter w)

Saves the XML document to the specified XmlWriter.