Updated parser method to correctly parse XML data