title: Inflate tree structure C#
body: <p>I have a stree structure which i can flatten into an array basically by using:</p>
  
  <pre><code>    public IEnumerable&lt;T&gt; Flatten()
      {
      return new[] { Value }.Union(_children.SelectMany(x =&gt; x.Flatten()));
      }
  </code></pre>
  
  <p>Is there a way to reverse this to restore the tree struture as it was before the "flatten"?</p>