def get_schema_filename(xml):
    """Return the filename of the schema file that corresponds to the given XML object.

    :param xml: the pre-parsed XML object
    :return: the XSD filename
    """
    xml_schema_location_key = (
        '{http://www.w3.org/2001/XMLSchema-instance}schemaLocation')
    element_root = xml.getroot()
    if element_root is None:
        return None
    element_schema_location = element_root.get(xml_schema_location_key)
    if element_schema_location is None:
        return None
    schema_location = element_schema_location.split()[1]
    schema_filename = schema_location.rpartition('/')[2]
    return schema_filename
