Updated parsing of XML to first perform XSD validation