title: How to read tree from xml C#
body: <p>I have following class used to keep a tree.</p>
  
  <pre><code>public class TreeNode
  {
      private Dictionary&lt;string, DataInfo&gt; node;
      private List&lt;TreeNode&gt; children = new List&lt;TreeNode&gt;();
      ...
      ...
  }
  </code></pre>
  
  <p>The DataInfo is like:</p>
  
  <pre><code>public class DataInfo
  {
      public Type Type { get; set; }
      public object Data { get; set; }
  }
  </code></pre>
  
  <p>I have created a method in this class to save this tree nodes into XML. The XML looks like:</p>
  
  <pre><code>&lt;Tree&gt;
    &lt;Node&gt;
      &lt;Item Type="System.String"&gt;
        &lt;Property&gt;Name&lt;/Property&gt;
        &lt;Value&gt;v1&lt;/Value&gt;
      &lt;/Item&gt;
      &lt;Item Type="System.Int32"&gt;
        &lt;Property&gt;i&lt;/Property&gt;
        &lt;Value&gt;1&lt;/Value&gt;
      &lt;/Item&gt;
      &lt;Node&gt;
        &lt;Item Type="System.String"&gt;
          &lt;Property&gt;Name&lt;/Property&gt;
          &lt;Value&gt;v2&lt;/Value&gt;
        &lt;/Item&gt;
        ...
        ...
        &lt;Node&gt;
            ...
            ...
  </code></pre>
  
  <p>How to parse this XML file to read into my TreeNode object? Any clue/help will be helpful.</p>