The previous sections of this chapter provided you with a general understanding of XML, how it is structured and how it can be accessed and manipulated using the .NET Framework. This section covers working with XML using newer features, specifically Language Integrated Query (LINQ), added in version 3.5 of the framework.
With the introduction of LINQ to the .NET Framework, the focus was on easy access to the data that you want to work with in your applications. One of the main data stores in the application space is XML, so it was really a no-brainer to create the LINQ to XML implementation. With the inclusion of System.Xml.Linq, you now have a series of capabilities that make the process of working with XML in your code much easier to achieve.
This chapter will only touch on how LINQ is used in relationship to XML. For the more basic description of LINQ and how it is used or works in a general sense, refer to chapter 9.
Even if the LINQ querying capability were not around, the new objects available to work with the XML are so good that they can even stand on their own outside LINQ. Within the new System.Xml.Linq namespace, you will find a series of new LINQ to XML helper objects that make working with an XML document in memory that much easier. The following sections describe the new objects that are available within this new namespace.