Little Modification of loadXML() function