title: Linq to XML - Deserialize to Object
body: <p>I have been able to get Linq to XML to work, but I wanted to see if there was a more efficient way of applying the elements to an object rather then putting a foreach statement after I have traversed the xml? I know you can use lamba expressions, but not sure how to apply that to this or if that is possible?</p>
  
  <p>Any suggestions greatly appreciated. </p>
  
  <pre><code>List&lt;Order&gt; myOrders = new List&lt;Order&gt;();
  
  var orders = from order in xdoc.Descendants("Order")
               select new{
                    OrderNumber = order.Element("OrderNumber").Value,
                    OrderDate = order.Element("OrderDate").Value,
                    OrderTotal = order.Element("OrderTotal").Value
               };
  
  foreach(var ord in orders)
  {
     myOrders.OrderNumber = ord.OrderNumber;
     myOrders.OrderDate = ord.OrderDate;
     myOrders.OrderTotal = ord.OrderTotal;
  }
  </code></pre>