title: How to Split an XML file into multiple XML Files
body: <p>I am trying to split a XML file to multiple small xml files in C#.net and am
  trying to get the best possible approach to this. Any help on this will be
  great... Sample example on what I am trying to do...</p>
  
  <h2>Source XML document</h2>
  
  <pre><code>&lt;?xml version="1.0" standalone="yes"?&gt;
  &lt;DATABASE&gt;
    &lt;DOC&gt;
      &lt;DOCID&gt;8510188&lt;/DOCID&gt;
      &lt;ISSUE&gt;2010&lt;/ISSUE&gt;
      &lt;CAT&gt;Literature and Art&lt;/CAT&gt;
      &lt;TITLE&gt;Test&lt;/TITLE&gt;
      &lt;TEXT&gt;Test&lt;/TEXT&gt;
    &lt;/DOC&gt;
    &lt;DOC&gt;
      &lt;DOCID&gt;1510179&lt;/DOCID&gt;
      &lt;ISSUE&gt;2012&lt;/ISSUE&gt;
      &lt;CAT&gt;Miscellaneous&lt;/CAT&gt;
      &lt;TITLE&gt;Test&lt;/TITLE&gt;
      &lt;TEXT&gt;Test&lt;/TEXT&gt;
    &lt;/DOC&gt;
  &lt;/DATABASE&gt;
  </code></pre>
  
  <h2>Should split to two xml documents as below</h2>
  
  <p>1)</p>
  
  <pre><code>&lt;?xml version="1.0" standalone="yes"?&gt;
  &lt;DATABASE&gt;
    &lt;DOC&gt;
     &lt;DOCID&gt;8510188&lt;/DOCID&gt;
     &lt;ISSUE&gt;2010&lt;/ISSUE&gt;
     &lt;CAT&gt;Literature and Art&lt;/CAT&gt;
     &lt;TITLE&gt;Test&lt;/TITLE&gt;
     &lt;TEXT&gt;Test&lt;/TEXT&gt;
    &lt;/DOC&gt;
  &lt;/DATABASE&gt;
  </code></pre>
  
  <p>2)</p>
  
  <pre><code>&lt;?xml version="1.0" standalone="yes"?&gt;
  &lt;DATABASE&gt;
    &lt;DOC&gt;
      &lt;DOCID&gt;1510179&lt;/DOCID&gt;
      &lt;ISSUE&gt;2012&lt;/ISSUE&gt;
      &lt;CAT&gt;Miscellaneous&lt;/CAT&gt;
      &lt;TITLE&gt;Test&lt;/TITLE&gt;
      &lt;TEXT&gt;Test&lt;/TEXT&gt;
    &lt;/DOC&gt;
  &lt;/DATABASE&gt;
  </code></pre>