title: how to split an XML file into multiple XML files using java
body: <p>I'm using XML files in Java for the first time and i need some help. I am trying to split an XML file to multiple XML files using Java</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;products&gt;
      &lt;product&gt;
          &lt;description&gt;Sony 54.6" (Diag) Xbr Hx929 Internet Tv&lt;/description&gt;
          &lt;gtin&gt;00027242816657&lt;/gtin&gt;
          &lt;price&gt;2999.99&lt;/price&gt;
          &lt;orderId&gt;2343&lt;/orderId&gt;
          &lt;supplier&gt;Sony&lt;/supplier&gt;
      &lt;/product&gt;
      &lt;product&gt;
          &lt;description&gt;Apple iPad 2 with Wi-Fi 16GB - iOS 5 - Black
          &lt;/description&gt;
          &lt;gtin&gt;00885909464517&lt;/gtin&gt;
          &lt;price&gt;399.0&lt;/price&gt;
          &lt;orderId&gt;2343&lt;/orderId&gt;
          &lt;supplier&gt;Apple&lt;/supplier&gt;
      &lt;/product&gt;
      &lt;product&gt;
          &lt;description&gt;Sony NWZ-E464 8GB E Series Walkman Video MP3 Player Blue
          &lt;/description&gt;
          &lt;gtin&gt;00027242831438&lt;/gtin&gt;
          &lt;price&gt;91.99&lt;/price&gt;
          &lt;orderId&gt;2343&lt;/orderId&gt;
          &lt;supplier&gt;Sony&lt;/supplier&gt;
      &lt;/product&gt;
      &lt;product&gt;
          &lt;description&gt;Apple MacBook Air A 11.6" Mac OS X v10.7 Lion MacBook
          &lt;/description&gt;
          &lt;gtin&gt;00885909464043&lt;/gtin&gt;
          &lt;price&gt;1149.0&lt;/price&gt;
          &lt;orderId&gt;2344&lt;/orderId&gt;
          &lt;supplier&gt;Apple&lt;/supplier&gt;
      &lt;/product&gt;
      &lt;product&gt;
          &lt;description&gt;Panasonic TC-L47E50 47" Smart TV Viera E50 Series LED
              HDTV&lt;/description&gt;
          &lt;gtin&gt;00885170076471&lt;/gtin&gt;
          &lt;price&gt;999.99&lt;/price&gt;
          &lt;orderId&gt;2344&lt;/orderId&gt;
          &lt;supplier&gt;Panasonic&lt;/supplier&gt;
      &lt;/product&gt;
  &lt;/products&gt;
  </code></pre>
  
  <p>and I'm trying to get three XML documents like:</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;products&gt;
          &lt;product&gt;
              &lt;description&gt;Sony 54.6" (Diag) Xbr Hx929 Internet Tv&lt;/description&gt;
              &lt;gtin&gt;00027242816657&lt;/gtin&gt;
              &lt;price currency="USD"&gt;2999.99&lt;/price&gt;
              &lt;orderid&gt;2343&lt;/orderid&gt;
          &lt;/product&gt;
          &lt;product&gt;
              &lt;description&gt;Sony NWZ-E464 8GB E Series Walkman Video MP3 Player Blue&lt;/description&gt;
              &lt;gtin&gt;00027242831438&lt;/gtin&gt;
              &lt;price currency="USD"&gt;91.99&lt;/price&gt;
              &lt;orderid&gt;2343&lt;/orderid&gt;
          &lt;/product&gt;
  &lt;/products&gt;
  </code></pre>
  
  <p>one for each supplier. How can I receive it? Any help on this will be great. </p>