def METHOD_NAME(root, import_base):
    """
    Reads an Ai.xml file, detects the type, and then pulls in the dependencies. Recursively looks for dependencies in
    import_dictionaries by inferring dependencies for each type of dictionary.
    :param root: input XML file to parsed, root of tree
    :param import_base: base of imported dictionaries, used for finding and opening them
    :return: dependencies set
    """
    # Read the file into the XML libraries
    ai_type = root.tag
    dependencies = set(BASIC_DEPENDENCIES[ai_type])
    kind = root.attrib.get("kind", None)
    if kind in KIND_DEPENDENCIES:
        dependencies.update(KIND_DEPENDENCIES[kind])
    # Import component/serializable/port types
    for import_type in [
        "import_port_type",
        "import_component_type",
        "import_serializable_type",
        "include_header",
        "import_enum_type",
        "import_array_type",
        "import_topology",
    ]:
        dependencies.update(read_fprime_import(import_type, root))
    # Other items based on what tags are declared here specifically
    for extra in BASIC_DEPENDENCIES.keys():
        for cell in root.findall(".//{0}".format(extra)):
            dependencies.update(BASIC_DEPENDENCIES[extra])
            kind = cell.attrib.get("kind", None)
            if kind in KIND_DEPENDENCIES:
                dependencies.update(KIND_DEPENDENCIES[kind])
    # Recurse imports for other importables
    for recurse_ai in root.findall("import_dictionary"):
        tmptree = xml.etree.ElementTree.parse(
            os.path.join(import_base, recurse_ai.text)
        )
        newroot = tmptree.getroot()
        dependencies.update(METHOD_NAME(newroot, import_base))
    return dependencies