title: XDocument to List of object
body: <p>The content of an XDocument is the XML below.</p>
  
  <p>I'd like to get a List(), see at the end of this message.</p>
  
  <pre><code>&lt;myXml&gt;
    &lt;myDatas code="01"&gt;
      &lt;myVar name="myvar" value="A" /&gt;
      &lt;myData name="A" value="A1" /&gt;
      &lt;myData name="B" value="B1" /&gt;
    &lt;/myDatas&gt;
    &lt;myDatas code="02"&gt;
      &lt;myVar name="myvar" value="B" /&gt;
      &lt;myData name="A" value="A2" /&gt;
      &lt;myData name="D" value="D2" /&gt;
    &lt;/myDatas&gt;
  &lt;/myXml&gt;
  
  public class MyData
  {
      public string MainCode { get; set; }
      public string Code { get; set; }
      public string Value { get; set; }
  }
  </code></pre>
  
  <p>I'd like a List() this content should be like this :</p>
  
  <pre><code>new MyData { MainCode = "01"; Code = "A"; Value = "A1" };
  new MyData { MainCode = "01"; Code = "B"; Value = "B1" };
  new MyData { MainCode = "02"; Code = "A"; Value = "A2" };
  new MyData { MainCode = "02"; Code = "D"; Value = "D2" };
  </code></pre>