For the uninitiated, the answer was (as nicely demonstrated by Kalai Selvan T's example) that the output file was being recreated every time savePreOrder() was called (i.e. for each node in the tree). The resulting output file would simply have contained the data for a single tree node.
I'd better be right about that now!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com