code: def print_element(element):
      
      pretty = etree.tostring(
          element, pretty_print=True).decode('utf-8')
      print(pretty)
      return pretty
docs: Pretty- print an lxml.etree element.
  
      Parameters
      ------------
      element : etree element