added xml and json file saving