def _get_target_hname(elt):
    """
    elt is sthg like:

    resource "xxx" {
        target="#yyy"
        some_elt {...}
    }

    return the concatenated "#yyy/xxx" or uses the tag of 'some_elt'

    """
    cmd_name = elt.get("name") or elt.text
    target = elt.get("target")

    if cmd_name is not None and target is not None:
        target = target + "/" + cmd_name
    elif cmd_name is not None:
        target = cmd_name
    else:
        # use the tag of the contained element
        assert elt is not None
        target = elt[0].tag

    return target