from lxml import etree xsd_schema=open('atp_vo_feed_schema.xsd') xml_file=open('lhcb_feed.xml') xsd_parsed=etree.parse(xsd_schema) xsd_parsed_schema=etree.XMLSchema(xsd_parsed) xml_parsed=etree.parse(xml_file) if xsd_parsed_schema.validate(xml_parsed): print "Sucess.\n It's valid XML feed." else: print "Error:Invalid XML\n" print xsd_parsed_schema.error_log