Problem with saving data from Arduino

first please post your whole Arduino code (or a stripped version that shows the problem.
second 57600 baud is the least favorite baud rate IIRC.

My assumption is that you do not synchronize the start and stop of the data stream over the serial . If you look at an XML file you see al those < and > to synchronize the parsing of the stream.
So processing should wait until she gets the start byte before capturing data.