Client/Frame: avoid use of lxml-only getparent()

getparent is not supported by xml.etree so try to emulate it
with a generated parent_map. This is the only possibility, because
xml.etree does not store references to the parent elements.