format file and modify xml file