I am trying to parse xml using JDOM. The problem is i want split a huge xml file into smaller files. The huge xml contains many <page></page>. I want to treat each <page></page> as a page. I am not able to find a function which could just copy the everything from <page>,</page> to different files.
Out0.xml
<page>
</page>
out1.xml
<page>
</page>
Brute options are to go through each tag copying every data, but that is boring. Is there a way I could copy all bytes within <page>,<page> different pages? Is there a function similar to VTD-xml::getXML().getBytes();