add prepareFileToWriting method
change xml formatting