Personally, I avoid to use XML unless I really need to...
For data as simple as the one you show, not hierarchic nor with optional elements, etc., a simple CSV format is more than enough.
As you guessed, make an array of strings holding the textual data to save, separated by semi-colon or tabs, using toString() if you have a class, or "manually" if you use separate arrays, then use saveStrings() (plural, here...).
Note that if you have really lot of data, this isn't very efficient (convert data to a big array of strings) so if you are concerned by that (memory limitation), you can use the method used by saveStrings(), generating the lines on the fly:
Code: File file = saveFile("dataToSave.csv");
OutputStream output = createOutput(file)
PrintWriter writer = createWriter(output);
for (int i = 0; i < dataLlength; i++) {
String line = x[i] + ";" + y[i] + ";" + stat1[i] + ";" + stat2[i];
// or String line = agent[i].toString();
writer.println(line);
}
writer.flush();
writer.close();
Likewise, you might want to split the reading of data to generate it line per line.
Processing just hides this complexity because most data is small enough to fit in memory anyway.