def METHOD_NAME(doc, xsd_name, xsd_basedir=None):
    if xsd_basedir is None:
        xsd_basedir = os.path.join(os.path.dirname(__file__), 'schemas')
    xsd_filename = os.path.join(xsd_basedir, xsd_name)
    with open(xsd_filename, 'rb') as schema:
        xsd = etree.parse(schema)
        xml_schema = etree.XMLSchema(xsd)
        if isinstance(doc, (string_type, bytes)):
            xml = etree.XML(doc)
        else:
            xml = doc
        is_valid = xml_schema.validate(xml)
        print(xml_schema.error_log.filter_from_errors())
        return is_valid