Created a generic switch in uploadXML