code: def element_is_empty(elem_to_parse, element_path=None):
      
  
      element = get_element(elem_to_parse, element_path)
  
      if element is None:
          return True
  
      is_empty = (
          (element.text is None or not element.text.strip()) and
          (element.tail is None or not element.tail.strip()) and
          (element.attrib is None or not len(element.attrib)) and
          (not len(element.getchildren()))
      )
  
      return is_empty
docs: Returns true if the element is None, or has no text, tail, children or attributes.
      Whitespace in the element is stripped from text and tail before making the determination.