Depends on the size of your file. I highly recommend you SAX to parse
XML in Java
I've been building application to read XML files, i was using JDOM
which was fine for small XML file, then when it's a huge one i had
OutOfMemory problems.
Then i changed to SAX, and i have no problems at all. It maybe a
little bit trickier to map the element, especially if it is a very big
XML file with dupicates element names. But it's definitely worth it.
Alot more efficient than DOM, for sure.