How to write data to an xml file
===

I want to store data (preferences) into an xml file , but I can't achieve it. I took a look at appledeveloper web but it seems not clear to me .
can you give me a good tutorial or an example that shows that please?