title: Save XDocument without storing it in memory
body: <p>I have a class that processes <code>XML</code> files. It works, but the problem is that, everything is being processed in <code>RAM</code>. I need to do something (like using <code>XmlWriter</code> class) to make it save on <code>HDD</code> while creating a new <code>XML</code> file (the data is very large that's why).</p>
  
  <p>How to do that in the best way? I hope there's no need to change <code>XDocument</code> into <code>XmlDocument</code> :/</p>
  
  <p><strong>e.g.</strong> - I have something like <code>XML</code> structure below and I want to add one node, save it into the file, dispose the element, then create a new node, save it... etc.</p>
  
  <pre><code>&lt;root&gt;
     &lt;element no='1' /&gt;
     &lt;element no='2' /&gt;
     &lt;element no='3' /&gt;
     &lt;element no='4' /&gt;
  &lt;/root&gt;
  </code></pre>