Saving generated xml into a file