Overview
XMLDocument is a fundamental building block of the System.Xml class hierarchy. It essentially inherits and extends the XMLNode class, and represents a W3C DOM-compliant XML document in its entirety. Once created or loaded into memory, its contents can be accessed, edited, and manipulated.
Key methods of this class include Load and LoadXml. The former is primarily used to retrieve XML using a resource path, whereas the latter accepts a string value consisting of an XML document or fragment. The InnerText, InnerXml, and OuterXml properties conveniently allow you to retrieve values and XML markup from a document. Below are three examples demonstrating the use of the XMLDocument class.