title: Generate xml using LINQ to XML
body: <p>Suppose that I have a class that looks like below,
  how do I create xml like below using LINQ to XML? </p>
  
  <pre><code>public class Order
  {
    public string OrderNo {get; set;}
    public string ItemId {get; set;}
    public string ItemDesc {get; set;}
    public int Qty {get; set;}
  }
  </code></pre>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;orders&gt;
    &lt;orderid&gt;
       &lt;orderno&gt;1&lt;/orderno&gt;
       &lt;itemid&gt;W001&lt;/itemid&gt;
       &lt;itemdesc&gt;C# T-Shirst&lt;/itemdesc&gt;
       &lt;quantity&gt;2&lt;/quantity&gt;
    &lt;/orderid&gt; 
    &lt;orderid&gt;
       &lt;orderno&gt;2&lt;/orderno&gt;
       &lt;itemid&gt;W002&lt;/itemid&gt;
       &lt;itemdesc&gt;XML T-Shirt&lt;/itemdesc&gt;
       &lt;quantity&gt;1&lt;/quantity&gt;
    &lt;/orderid&gt;
  &lt;/orders&gt;
  </code></pre>