def _wrap(element, output, wrapper=u''):
 output.append(wrapper)
 if element.text:
  output.append(_collapse_whitespace(element.text))
 for child in element:
  _element_to_text(child, output)
 output.append(wrapper)

def _wrap ( element , output , wrapper = u'' ) : output . append ( wrapper ) if element . text : output . append ( _collapse_whitespace ( element . text ) ) for child in element : _element_to_text ( child , output ) output . append ( wrapper )
recursively extracts text from element .