title: Calling the DescendantNodes without repeating each node
body: <p>I have an xml that I would like to get all of its elements. I tried getting those elements by Descendants() or DescendantNodes(), but both of them returned me repeated nodes </p>
  
  <p>For example, here is my xml:</p>
  
  <pre><code>&lt;Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
    &lt;FirstElement xsi:type="myType"&gt;
      &lt;SecondElement&gt;A&lt;/SecondElement&gt; 
    &lt;/FirstElement&gt;
  &lt;/Root&gt;
  </code></pre>
  
  <p>and when I use this snippet:</p>
  
  <pre><code> XElement Elements = XElement.Parse(XML);
   IEnumerable&lt;XElement&gt; xElement = Elements.Descendants();
   IEnumerable&lt;XNode&gt; xNodes = Elements.DescendantNodes();
   foreach (XNode node in xNodes )
   {
       stringBuilder.Append(node);
   }
  </code></pre>
  
  <p>it gives me two nodes but repeating the <code>&lt;SecondElement&gt;</code>. I know Descendants call its children, and children of a child all the time, but is there any other way to avoid it?</p>
  
  <p>Then, this is the content of my stringBuilder:</p>
  
  <pre><code>&lt;FirstElement xsi:type="myType"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
     &lt;SecondElement&gt;A&lt;/SecondElement&gt; 
  &lt;/FirstElement&gt;
  
  &lt;SecondElement&gt;A&lt;/SecondElement&gt;
  </code></pre>