Here, and a few other places we're asked to pass a .tree argument as mets_doc, in this case, to validate the document:
def xsd_validate(mets_doc, xmlschema=METS_XSD_PATH):
xmlschema = get_xmlschema(xmlschema, mets_doc)
is_valid = xmlschema.validate(mets_doc)
error_log = xmlschema.error_log
return is_valid, error_log
I wonder if the METSDocument itself wouldn't be a nicer abstraction to be passing around functions such as this when using this utility?