Filewrite
finished
added function to create the  preferencesxml file