Parsing XML Files using LINQ to XML

LINQ (Language Integrated Query) is a .NET technology that allows you to query data on different sources such as in-memory data objects, SQL Server, and XML using either query expressions or lambda expression extension methods. In this post, we will be looking more at how to use LINQ on parsing XML files using query expressions.

Now, query expressions are easier to write since it has a resemblance to and uses similar keywords to that being used in constructing SQL statements. The basic rule to remember in constructing a query expression is that it always begins with a from and ends with either a select or group by. That's a bit weird if you're used to the SQL's SELECT syntax because in SQL, you always begin with SELECT and not with a FROM but you'll get used to the syntax once you use it on a daily basis...