Record which tag ids map to attribute nodes. Use that in subtree_element