def xmlvalid(xml, xsd):

    xsd1 = etree.parse(xsd)
    xsd2 = etree.XMLSchema(xsd1)

    doc = etree.parse(StringIO(xml))
    return xsd2.validate(doc)
Test whether an XML document is valid
dataset/ETHPy150Open geopython/OWSLib/owslib/util.py/xmlvalid