What's the best way to write an XML file?

I tried using QFile and QTextStream...but any time I wanted to add something to the file...it would delete the current data. Is there a way to write to a file and not delete the contents?

I know about QDomDocument....but I'm having some difficultity trying to understand exactly how the formatting goes then getting to a file.

Thanks!

Rob