using System.Collections.Generic;
namespace ConsoleApplication2
public static void Main(string[] args)
@"<JPRoutePositionET xsi:schemaLocation=""urn:connexionz-co-nz:jp JourneyPlanner.xsd"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:connexionz-co-nz:jp"">
<Content MaxArrivalScope=""60"" Expires=""2015-06-14T20:21:01+12:00""/>
<Platform Name=""Manchester St Gloucester St"" PlatformTag=""3330"">
<Route Name=""Orange Line"" RouteNo=""O"">
<Destination Name=""Queenspark"">
<Trip WheelchairAccess=""true"" TripNo=""5497"" ETA=""28""/>
<Trip WheelchairAccess=""true"" TripNo=""5498"" ETA=""59""/>
var loadedData = XDocument.Parse(xml);
XNamespace d = "urn:connexionz-co-nz:jp";
var data = from route in loadedData.Descendants(d+"Route")
from destination in route.Elements(d+"Destination")
from trip in destination.Elements(d+"Trip")
let routeNo = (string)route.Attribute(d + "RouteNo") ?? "test"
let currentDestination = (string)destination.Attribute(d + "Name") ?? "test"
Destination = currentDestination,
Eta = (string)trip.Attribute("ETA") ?? "5"
foreach (var foo in data)