title: XML writing problem
body: <p>I am trying to write to an xml file in a certain structure and am experiencing some issues. I want to write several XElements to a certain XElement in an XML. For ex:</p>
  
  <pre><code>        foreach (XMLFieldInfo Field in XMLFields)
              Fields.Add(new XElement("Field", new XElement("Name", Field.FieldID), new XElement("InclusionItems", Field.InclusionListToWriteToXML), new XElement("ExclusionItems", Field.ExclusionListToWriteToXML)));
  </code></pre>
  
  <p>Here i build several XElements i want to add as subnodes to another node in an xml.</p>
  
  <pre><code>XElement LockboxConfigTree = new XElement("Student", new XElement("ID", cmbID.Text.Trim()), .................);
  </code></pre>
  
  <p>The ...... is where each element in the list created above will be added but i dont know how many elements there are so i cant find a way to add it to the supernode.</p>
  
  <p>The above is the supernode i want to add the subnodes created above to. The problem is, i cant seem to get the right logic so in the end, the xml will look like this:</p>
  
  <pre><code>&lt;Student&gt;
     &lt;ID&gt;&lt;/ID&gt;
     &lt;Field&gt;
       &lt;Name&gt;&lt;/Name&gt;
       &lt;InclusionList&gt;&lt;/InclusionList&gt;
       &lt;ExclusionList&gt;&lt;/InclusionList&gt;
     &lt;/Field&gt;
  &lt;/Student&gt;
  </code></pre>