XML
Context: LINQ to XML (using System.Xml.Linq) provides a modern, in‑memory XML API with query capabilities.
using System.Xml.Linq;
XDocument doc = XDocument.Parse(@" <books> <book title='C# Programming' price='49.99'/> <book title='LINQ in Action' price='39.99'/> </books>");
var expensiveBooks = from b in doc.Descendants("book") where (decimal)b.Attribute("price") > 40 select b.Attribute("title").Value;Real-world usage example
Section titled “Real-world usage example”Configuration file querying: Use LINQ to XML to read and filter settings from XML configuration files.
Example: LINQ to XML documentation shows many examples for querying XML.