def METHOD_NAME(dxo: DXO, name: str, result, errors, visited: dict):
    obj_id = id(dxo)
    if visited.get(obj_id):
        print(f"dxo {name} already visited - ignore it")
        return
    visited[obj_id] = True
    if not isinstance(dxo, DXO):
        errors.append(f"dxo '{name}' must be DXO but got {type(dxo)}")
        return
    if dxo.data_kind == DataKind.COLLECTION:
        if not isinstance(dxo.data, dict):
            errors.append(f"dxo '{name}' is a collection but data is {type(dxo.data)} - must be dict")
            return
        for k, v in dxo.data.items():
            METHOD_NAME(v, f"{name}.{k}", result, errors, visited)
    else:
        result[name] = dxo