title: Traverse class Tree and convert to the needed type
body: <p>i have a class similar to this:</p>
  
  <pre><code>public class Channel
  {
     public string Title {get;set;}
     public Guid Guid {get;set;}
     public List&lt;Channel&gt; Children {get;set;}
     // a lot more properties here
  }
  </code></pre>
  
  <p>i need to convert this class tree to a the same tree structure,
  but with less properties (and different names for the properties)
  i.e:</p>
  
  <pre><code>public class miniChannel
  {
      public string title {get;set;}
      public string key {get;set;}
      public List&lt;miniChannel&gt; children {get;set;}
      // ALL THE OTHER PROPERTIES ARE NOT NEEDED
  }
  </code></pre>
  
  <p>i was thinking it would be easy traversing the tree with the following function:</p>
  
  <pre><code>public IEnumerable&lt;MyCms.Content.Channels.Channel&gt; Traverse(MyCms.Content.Channels.Channel channel)
  {
      yield return channel;
      foreach (MyCms.Content.Channels.Channel aLocalRoot in channel.Children)
      {
          foreach (MyCms.Content.Channels.Channel aNode in Traverse(aLocalRoot))
          {
              yield return aNode;
          }
      }
  }
  </code></pre>
  
  <p>how should i change the function so i could return a <code>IEnumerable&lt;miniChannel&gt;</code>
  or, alternatively, is there some other way to do it?
  Please notice that i cannot change the source class <code>Channel</code></p>