updated to process xml before uploading