Accepted answer

You can achieve this by using linq as you thought, somthing like this should work, just add more elements if required for itemprice etc.. : (Where ns is the namespace)

xmlDoc = XDocument.Parse(sr.ReadToEnd());

XNamespace ns = "";

var query = from order in xmlDoc.Descendants(ns + "Order")
            from orderItem in order.Elements(ns + "OrderItem")
            select new
                amazonOrdeID = order.Element(ns + "AmazonOrderID").Value,
                merchantOrderID = order.Element(ns + "MerchantOrderID ").Value,
                orderStatus = order.Element(ns + "OrderStatus ").Value,
                asin = orderItem.Element(ns + "ASIN").Value,
                quantity = orderItem.Element(ns + "quantity").Value

using the above you shold be able to bring back all the information you need per amazon order in a singleline...


We've since decided to use an alternate method, so I didn't get a chance to fully test the solution, I am marking as complete due to a change in direction.

More Query from same tag