def METHOD_NAME(allocation_etree, vm_id, devdict):
    for dev in devdict:
        dev_name = dev
        bdf = devdict.get(dev)
        vm_node = get_node(f"/acrn-config/vm[@id = '{vm_id}']", allocation_etree)
        if vm_node is None:
            vm_node = acrn_config_utilities.append_node("/acrn-config/vm", None, allocation_etree, id = vm_id)
        dev_node = get_node(f"./device[@name = '{dev_name}']", vm_node)
        if dev_node is None:
            dev_node = acrn_config_utilities.append_node("./device", None, vm_node, name = dev_name)
        if get_node(f"./bus", dev_node) is None:
            acrn_config_utilities.append_node(f"./bus",  f"{bdf.bus:#04x}", dev_node)
        if get_node(f"./dev", dev_node) is None:
            acrn_config_utilities.append_node(f"./dev", f"{bdf.dev:#04x}", dev_node)
        if get_node(f"./func", dev_node) is None:
            acrn_config_utilities.append_node(f"./func", f"{bdf.func:#04x}", dev_node)