LINQ to XML is a language-agnostic component of the LINQ Project. Functional construction is described further in the section titled "Creating XML From Scratch." Document "free" When programming XML your primary focus is usually on XML elements and perhaps attributes.
The samples in most of this document are shown in C# for brevity. This makes sense because an XML tree, other than at the leaf level, is composed of XML elements and your primary goal when working with XML is traversing or manipulating the XML elements that make up the XML tree.
LINQ to XML can be used just as well with a LINQ-enabled version of the Visual Basic . Section "LINQ to XML in Visual Basic 9.0" discusses Visual Basic-specific programming with LINQ to XML in more detail. In LINQ to XML you can work directly with XML elements in a natural way.
For the purposes of this paper let's establish a simple XML contact list sample that we can use throughout our discussion. For example you can do the following: Compare this to W3C DOM, in which the XML document is used as a logical container for the XML tree.
Because LINQ to XML provides a fully featured in-memory XML programming API you can do all of the things you would expect when reading and manipulating XML. Here is a fragment of the code from the previous example to create a name element: Note how the XML document is a fundamental concept in DOM.Michael Champion February 2007 Applies to: Visual Studio Code Name "Orcas" .