def get_xml_text(element, mini_dom=False):
 text = ''
 if mini_dom:
  node = element
  for child in node.childNodes:
   if (child.nodeType in (Node.CDATA_SECTION_NODE, Node.TEXT_NODE)):
    text += child.data
 elif (element is not None):
  for child in ([element] + element.findall('.//*')):
   if child.text:
    text += child.text
 return text.strip()

def get_xml_text ( element , mini_dom = False ) : text = '' if mini_dom : node = element for child in node . childNodes : if ( child . nodeType in ( Node . CDATA_SECTION_NODE , Node . TEXT_NODE ) ) : text += child . data elif ( element is not None ) : for child in ( [ element ] + element . findall ( './/*' ) ) : if child . text : text += child . text return text . strip ( )
get all text inside a xml element element: a xml element either created with elementtree .