code: def get_element(text_or_tree_or_element):
      
      if isinstance(text_or_tree_or_element, ET.Element):
          return text_or_tree_or_element
      elif isinstance(text_or_tree_or_element, ET.ElementTree):
          return text_or_tree_or_element.getroot()
      elif isinstance(text_or_tree_or_element, (unicode, bytes)):
          return ET.fromstring(text_or_tree_or_element)
      else:
          return ET.parse(text_or_tree_or_element).getroot()
docs: Get back an ET.Element for several possible input formats