System.Xml.Linq Namespace

Contains the classes for LINQ to XML. LINQ to XML is an in-memory XML programming interface that enables you to modify XML documents efficiently and easily.

Classes

Extensions

Contains the LINQ to XML extension methods.

XAttribute

Represents an XML attribute.

XCData

Represents a text node that contains CDATA.

XComment

Represents an XML comment.

XContainer

Represents a node that can contain other nodes.

XDeclaration

Represents an XML declaration.

XDocument

Represents an XML document. For the components and usage of an XDocument object, see XDocument Class Overview.

XDocumentType

Represents an XML Document Type Definition (DTD).

XElement

Represents an XML element. See XElement Class Overview and the Remarks section on this page for usage information and examples.

XName

Represents a name of an XML element or attribute.

XNamespace

Represents an XML namespace. This class cannot be inherited.

XNode

Represents the abstract concept of a node (element, comment, document type, processing instruction, or text node) in the XML tree.

XNodeDocumentOrderComparer

Contains functionality to compare nodes for their document order. This class cannot be inherited.

XNodeEqualityComparer

Compares nodes to determine whether they are equal. This class cannot be inherited.

XObject

Represents a node or an attribute in an XML tree.

XObjectChangeEventArgs

Provides data for the Changing and Changed events.

XProcessingInstruction

Represents an XML processing instruction.

XStreamingElement

Represents elements in an XML tree that supports deferred streaming output.

XText

Represents a text node.

Enums

LoadOptions

Specifies load options when parsing XML.

ReaderOptions

Specifies whether to omit duplicate namespaces when loading an XDocument with an XmlReader.

SaveOptions

Specifies serialization options.

XObjectChange

Specifies the event type when an event is raised for an XObject.

Remarks

Using LINQ to XML, you can:

  • Load XML from files or streams.

  • Serialize XML to files or streams.

  • Create XML trees from scratch using functional construction.

  • Query XML trees using LINQ queries.

  • Manipulate in-memory XML trees.

  • Validate XML trees using XSD.

  • Use a combination of these features to transform XML trees from one shape into another.

See also