In the general case, you can write to a file in append mode using:
new FileOutputStream(file, true);
The second parameter is a boolean with true meaning append and false meaning overwrite. The default is false (as you have no doubt discovered).
That being said, appending data to the end of an XML file probably does not make sense. It would be much better to use an XML reader to read the XML file into a Document
object, add elements to that object, and then write that object back to disk.