string filepath = @"c:\users\joel\downloads\loanstats.xml";
XDocument xml = XDocument.Load(filepath); var loansElements = xml.XPathSelectElements("//loan"); var loans = loansElements.Select(x => new { Id = x.Attribute("id").Value, AmountRequested = x.Attribute("amount-requested").Value, InterestRate = x.Attribute("interest-rate").Value // and so on });
foreach (var loan in loans) { Console.WriteLine("{0} - {1} @ {2}", loan.Id, loan.AmountRequested, loan.InterestRate); }
They also have each data file available as a CSV if you prefer to do things that way.