Write data into xml file