Added a XML parsing function at bottom