The LINQ to XML Object Model

With the new LINQ to XML API comes a new object model containing many new classes that exist in the System.Xml.Linq namespace. One is the static class where the LINQ to XML extension methods live, Extensions; two are comparer classes, XNodeDocumentOrderComparer and XNodeEqualityComparer, and the remaining are used to build your XML trees. Those remaining classes are displayed in the diagram shown in Figure 7-1.

LINQ to XML API object model

There are some interesting things to notice:

  1. Of those remaining classes, three are abstract, XObject, XContainer, and XNode, so you will never be constructing them.

  2. An attribute, ...

Get Pro LINQ: Language Integrated Query in C# 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.