Για πολύ όμορφο XML Querying μπορείς να χρησιμοποιήσεις LINQ to XML.
Ξεκινώντας με την XDocument.Load("xmlFile");
Και συνεχίζοντας δημιουργώντας queries ξεκινώντας από το root του αρχείου.
Μπορείς να πάρεις Attributes, Elements, και να κάνεις ότι θέλεις. Ακόμη έχεις και τις
extension methods. Και φυσικά όλα τα Linq results είναι αυτόματα και DataSource.
Example:
var customersInCountry =
from cust in customers.Descendants("Customer")
where cust.Element("Country").Value == myCountryParam
select new
{
CustomerID = cust.Attribute("CustomerID").Value,
Company = cust.Element("Company").Value,
Phone = cust.Element("Phone").Value
};