def load_xml_as_json_dict(xml_path):
    """Loads the XML file as a JSON dictionary.

    Args:
        xml_path: the path to the XML file

    Returns:
        a JSON dict
    """
    try:
        with open(xml_path, "rb") as f:
            return xmltodict.parse(f.read())
    except ExpatError as ex:
        raise ExpatError(f"Failed to read {xml_path}: {ex}")
Loads the XML file as a JSON dictionary.

    Args:
        xml_path: the path to the XML file

    Returns:
        a JSON dict
    
fiftyone/core/utils.py