title: How to generate an XML file dynamically using XDocument?
body: <p>As I wrote in the subject itself , how can I do that?<br>
  Note that solution like this are not appropriate as I want to create child nodes dynamically through running..</p>
  
  <pre><code>new XDocument(
      new XElement("root", 
          new XElement("someNode", "someValue")    
      )
  )
  .Save("foo.xml");
  </code></pre>
  
  <p><strong>I guess this was clear enough the first time but I will write it again:</strong>    </p>
  
  <p>I need to be able to add child nodes to given parent node while running, in the current syntax I've written this is static generated xml which doesn't contribute me at all because all is known in advance, which is not as my case.</p>
  
  <p>How would you do it with Xdocument, is there away?</p>