Image

Modifying XML file

I have an XML file that I read in and parse, and then based on some conditions I may need to modify the file and add a new node. Whats the best way to modify the file itself? I haven't seen a way to do it in the XML API. I'm looking through the file writer but concerned that reading in a large file, comparing, and writing the file back out would be slow.

The only caveat is it MUST be java 1.4.x. I can not use 1.5

Any suggestions?

Thanks