new function to read the xml file