How to save data

Hi,
I want to build stand alone application using flash8.
I don’t know how to store the input data to text file or xml file from flash.
please anyone help me how to save the text file and how to save the input data to xml.
thanks
regards
hema