|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Programming Guide (LINQ to XML)
This section provides conceptual and how-to information about programming with LINQ to XML.
This documentation targets developers who already understand C# and some basic aspects of the .NET Framework.
The goal of this documentation is to make LINQ to XML easy to use for all kinds of developers. LINQ to XML makes XML programming easier. You do not have to be an expert developer to use it.
LINQ to XML relies heavily on generic classes. Therefore, is very important that you understand the use of generic classes. Further, it is helpful if you are familiar with delegates that are declared as parameterized types. If you are not familiar with C# generic classes, see Generic Classes (C# Programming Guide).
Provides conceptual and task-based information about creating XML trees. You can create XML trees by using functional construction, or by parsing XML text from a string or a file. You can also use an XmlReader to populate an XML tree. Creating an XML tree in Visual Basic is very different from creating one in C#. These topics describe how to create XML trees in both languages.
Provides detailed information about creating XML trees that use namespaces.
Describes multiple approaches to serializing an XML tree, and gives guidance on which approach to use.
Enumerates and describes the LINQ to XML axis methods, which you must understand before you can write LINQ to XML queries.
Provides common examples of querying XML trees.
Like the Document Object Model (DOM), LINQ to XML enables you to modify an XML tree in place.
Provides information about annotations, events, streaming, and other advanced scenarios.
Describes security issues associated with LINQ to XML and provides some guidance for mitigating security exposure.
Contains the sample XML documents that are used by many examples in this documentation.