As might be expected by long-time forum participants, I would suggest not worrying about doing this in Java just yet.
How is this 10000 element document being submitted to IS? It sounds like you’ve already converted it to an IS document, containing a document list of 10000 entries. That may be an issue right from the start, though without detail about the size of the overall document and each entry it’s hard to say.
Here are a few thoughts that may be helpful:
Don’t load the bytes/string of the overall document into memory all at once. This means don’t use bytesToString, xmlStringToNode (where you pass a complete byte array or string), or xmlNodeToDocument. If the bytes are not already written to disk, you might consider doing so and then processing the file using an InputStream.
Consider using the node iterator facilities. This will keep the memory footprint of the source document small. For each entry, you’ll get a node representing that document which you can convert to an IS document, map and save/send/store/whatever. Just be sure not to create a huge target document with all 10000 entries.
With the node iterator you can control how many you build up in a batch–create 150 target documents then save/send/write to DB/whatever.
These items can be done without resorting to Java (though with the first one you might need a small bit of Java code to write the file, depending on your environment).