Writing and Uploading XML Files