Saving XML Files

I am in the process of making a map editor in AS3 that loads maps in through XML, and I need it to save files. It will only be running offline ina standalone player.

I have discovered how to create the XML data, but how do I write that into a file and save it?

Thanks in advance.