finish the function to edit xml file