.NET API Reference

Namespace: System.Xml.Linq

This namespace provides support for Language Integrated Query (LINQ) to XML.

LINQ to XML is an in-memory XML programming model. It allows you to represent an XML document as an object model that you can query using LINQ.

It offers a more unified and simpler API for working with XML compared to the Document Object Model (DOM).

Classes

Classes

XAttribute

Represents an attribute of an XElement.

XCData

Represents an XContainer node that contains CDATA.

XComment

Represents an XML comment.

XContainer

Represents an XML node that can contain other XML nodes.

XDeclaration

Represents the XML declaration of an XML document.

XDocument

Represents an XML document.

XDocumentType

Represents an XML document type declaration.

XElement

Represents an XML element.

XName

Represents an XML element or attribute name.

XNode

Represents a node in an XML tree.

XNodeEqualityComparer

Compares two XML nodes for equality.

XObject

Represents a node in an XML tree.

XObjectEqualityComparer

Compares two XObjects for equality.

XProcessingInstruction

Represents a processing instruction.

XText

Represents text content in an XML node.

Interfaces

Interfaces

IXmlLineInfo

Provides information about the line number and line position of an XML node.

IXmlNamespaceResolver

Resolves XML namespaces.

Extension Methods

Extension Methods (in System.Xml.Linq)

Elements

Extension method to get the child elements of an XContainer.

Attributes

Extension method to get the attributes of an XElement.

DescendantNodes

Extension method to get all descendant nodes of an XContainer.

DescendantNodesAndSelf

Extension method to get all descendant nodes and the current node of an XContainer.

NodesBeforeSelf

Extension method to get all nodes before the current node in its parent.

NodesAfterSelf

Extension method to get all nodes after the current node in its parent.

Ancestors

Extension method to get all ancestors of an XElement.

AncestorsAndSelf

Extension method to get all ancestors and the current element.

InDocumentOrder

Extension method to get all nodes in document order.