def _textlist(self, _addtail=False):
 result = []
 if ((not _addtail) and (self.text is not None)):
  result.append(self.text)
 for elem in self:
  result.extend(elem.textlist(True))
 if (_addtail and (self.tail is not None)):
  result.append(self.tail)
 return result

def _textlist ( self , _addtail = False ) : result = [ ] if ( ( not _addtail ) and ( self . text is not None ) ) : result . append ( self . text ) for elem in self : result . extend ( elem . textlist ( True ) ) if ( _addtail and ( self . tail is not None ) ) : result . append ( self . tail ) return result
returns a list of text strings contained within an element and its sub-elements .