title: XElement => Add children nodes at run time
body: <p>So let's assume this is what i want to achieve:</p>
  
  <pre><code>&lt;root&gt;
    &lt;name&gt;AAAA&lt;/name&gt;
    &lt;last&gt;BBBB&lt;/last&gt;
    &lt;children&gt;
       &lt;child&gt;
          &lt;name&gt;XXX&lt;/name&gt;
          &lt;last&gt;TTT&lt;/last&gt;
       &lt;/child&gt;
       &lt;child&gt;
          &lt;name&gt;OOO&lt;/name&gt;
          &lt;last&gt;PPP&lt;/last&gt;
       &lt;/child&gt;
     &lt;/children&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p><strong>Not sure if using XElement is the simplest way</strong><br>
  but this is what I have so far:  </p>
  
  <pre><code> XElement x = new XElement("root",
                    new XElement("name", "AAA"),
                    new XElement("last", "BBB"));
  </code></pre>
  
  <p>Now I have to add the "children" based on some data i have.<br>
  There could be 1,2,3,4 ...</p>
  
  <p>so I need to iterate thru my list to get every single child</p>
  
  <pre><code>foreach (Children c in family)
  {
      x.Add(new XElement("child", 
                new XElement("name", "XXX"),
                new XElement("last", "TTT")); 
  } 
  </code></pre>
  
  <h1><strong>PROBLEM:</strong></h1>
  
  <p>Doing this way I will be missing the "CHILDREN Parent node".
  If I just add it before the foreach, it will be rendered as a closed node</p>
  
  <pre><code>&lt;children/&gt;
  </code></pre>
  
  <p>and that's NOT what we want.</p>
  
  <h1><strong>QUESTION:</strong></h1>
  
  <p>How can I add to the 1st part a parent node  and as many  as my list has?</p>