LINQ to XML provides a really powerful way to efficiently
query, filter, and shape/transform XML data. You can use it both against
local XML content, as well as remote XML feeds. You can use it to easily
transform XML data into .NET objects and collections that you can further
manipulate and transfer across your application.
LINQ to XML uses the same core LINQ query syntax and
concepts that LINQ to SQL, LINQ to Objects, LINQ to SharePoint, LINQ to Amazon,
LINQ to NHibernate, etc. use when querying data. You can learn more about
the LINQ query syntax and the supporting language features being added to VB
and C# to support it from these previous blog posts of mine:
Automatic Properties, Object Initializer and Collection
Initializers
Extension Methods
Lambda Expressions
Query Syntax
Anonymous Types
You might also find these blog posts of mine useful to learn
more about LINQ to SQL:
Part 1: Introduction to LINQ to SQL
Part 2: Defining our Data Model Classes
Part 3: Querying our Database
Part 4: Updating our Database
Part 5: Binding UI using the ASP:LinqDataSource Control
In a future blog post I'll return to LINQ to XML and
demonstrate how it can be used not just to query XML, but also to really
cleanly generate XML output from a .NET data structure.
Hope this helps,
Scott