Added the XML helper function