Process XML Data Using LINQ to XML

LINQ to XML is the new model in the .NET Framework version 3.5 for processing XML data. LINQ to XML allows developers to do everything they would expect with XML data: querying, modifying, creating, saving, and serializing XML documents. The real advantages lie in the query and creation capabilities.

Queries in LINQ to XML are succinct and expressive, using syntax more similar to SQL than to XPath or XQuery. Because query results can be returned as collections of elements or attributes and can be used as parameters for XElement objects, XML trees can be easily transformed from one shape to another.

LINQ to XML leverages the language-integrated query (LINQ) technology in the .NET Framework version 3.5. LINQ extends the language syntax of C# and Visual Basic to provide powerful query capabilities that can be extended to potentially any data store.

See LINQ to XML for a detailed discussion of its use, and see Language-Integrated Query (LINQ) for an overview of the LINQ framework.

See Also

Concepts

LINQ to XML vs. DOM

LINQ to XML vs. Other XML Technologies

Reference

System.Xml.Linq

System.Linq