title: Converting XML to objects with nested embeded objects
body: <p>I have the following XML which has nested objects and when I want to deserialize the XML into the Steps class with the embedded list of Step objects, I have an error.</p>
  
  <pre><code>[XmlRoot(ElementName="comp")]
  public class Comp 
  {
      [XmlAttribute(AttributeName="ref")]
      public string Ref { get; set; }
      [XmlAttribute(AttributeName="dir")]
      public string Dir { get; set; }
  }
  
  [XmlRoot(ElementName="step")]
  public class Step 
  {
      [XmlElement(ElementName="comp")]
      public Comp Comp { get; set; }
      [XmlAttribute(AttributeName="name")]
      public string Name { get; set; }
      [XmlElement(ElementName="step")]
      public Step Step { get; set; }
  }
  
  [XmlRoot(ElementName="steps")]
  public class Steps 
  {
      [XmlElement(ElementName="step")]
      public Step Step { get; set; }
  }
  </code></pre>
  
  <p>My XML :</p>
  
  <pre><code>&lt;steps&gt;
    &lt;step name="2.3  Upper"&gt;
      &lt;step name="2.3.1 Upper"&gt;
        &lt;comp ref="15.txt" dir="D:\test" /&gt;
        &lt;comp ref="16.txt" dir="D:\test2" /&gt;
      &lt;/step&gt;
      &lt;step name="2.3.2  Upper" &gt;
        &lt;comp ref="19.txt" dir="D:\test" /&gt;
        &lt;comp ref="29.txt" dir="D:\test2" /&gt;
      &lt;/step&gt;
    &lt;/step&gt;
  &lt;/steps&gt;
  </code></pre>
  
  <p><strong>Update</strong>: new XML file for more nested step.</p>
  
  <pre><code>&lt;steps&gt;
    &lt;step name="2.3  Upper"&gt;
      &lt;step name="2.3.1 Upper"&gt;
        &lt;step name="2.3.1.1 Upper"&gt;
          &lt;comp ref="10.txt" dir="D:\test" /&gt;
        &lt;/step&gt;
        &lt;comp ref="15.txt" dir="D:\test" /&gt;
        &lt;comp ref="16.txt" dir="D:\test2" /&gt;
      &lt;/step&gt;
      &lt;step name="2.3.2  Upper" &gt;
        &lt;comp ref="19.txt" dir="D:\test" /&gt;
        &lt;comp ref="29.txt" dir="D:\test2" /&gt;
      &lt;/step&gt;
    &lt;/step&gt;
  &lt;/steps&gt;
  </code></pre>
  
  <p>May I ask your help how to get ride of the following error:</p>
  
  <blockquote>
    <p>'Step': member names cannot be the same as their enclosing type</p>
  </blockquote>
  
  <p>I am stuck on this error. I really appreciate for your helps.</p>