refactor elem.attrib.pop to pop_chilren_attr, element_to_remove.getparent().remove to remove_children