def getText(elem):
 l = []
 for element in elem.getiterator():
  if element.text:
   l.append(element.text)
  if element.tail:
   l.append(element.tail)
 return ' '.join(l)

def getText ( elem ) : l = [ ] for element in elem . getiterator ( ) : if element . text : l . append ( element . text ) if element . tail : l . append ( element . tail ) return ' ' . join ( l )
return the internal text for the given elementtree node .