System.Xml Namespace
Overview
The System.Xml
namespace provides standards-based support for processing XML. This namespace contains classes for working with XML documents, including parsing, manipulating, and querying XML data.
Key features include:
- Support for the Document Object Model (DOM) and Simple API for XML (SAX)
- XML Schema validation
- XPath querying
- XSL transformations
- XML digital signatures
- XML encryption
Core Classes
XmlDocument
Represents an XML document in memory using the Document Object Model (DOM).
Use XmlDocument
to load, navigate, and modify an XML document.
Assembly: System.Xml.dll
XmlReader
Provides fast, forward-only, read-only access to an XML document.
XmlReader
is a non-caching interface that enables efficient reading of large XML files.
Assembly: System.Xml.dll
XmlWriter
Provides a non-caching, forward-only way to write XML data.
Use XmlWriter
to create XML documents programmatically.
Assembly: System.Xml.dll
XmlNode
Represents a node in the XML document object model (DOM).
This is an abstract base class for all XML nodes, such as elements, attributes, and text.
Assembly: System.Xml.dll
Querying and Transformation
XPathNavigator
Navigates through an XmlDocument
or XmlNode
.
Provides a way to select nodes using XPath expressions.
Assembly: System.Xml.dll
XslCompiledTransform
Compiles and executes an XSLT stylesheet.
Use this class to apply transformations to XML documents.
Assembly: System.Xml.dll
Schema and Validation
XmlSchema
Represents an XML Schema definition language (XSD) schema.
Used for validating XML documents against a defined schema.
Assembly: System.Xml.dll
XmlSchemaException
Represents an error that occurs during XML Schema validation.
Assembly: System.Xml.dll