XML to file - keep it pretty?

NOTE: Problem sort of solved. It appears it was only losing its formatting when viewed in notepad…in almost anything else it appears fine.

Hi all!
I’m using FileReference to save out an XML file but passing the XML object as the save parameter. The only problem is, the written file doesn’t hold the pretty visual formatting and indenting. While any XML parser can still read it, it’s nearly impossible for human eyes to decipher…

Any ideas?