def getText(node, recursive=False):
    """Get all the text associated with this node.
       With recursive == True, all text from child nodes is retrieved."""
    L = [u'']
    for n in node.childNodes:
        if n.nodeType in (node.TEXT_NODE, node.CDATA_SECTION_NODE):
            L.append(n.data)
        else:
            if not recursive:
                return None
        L.append(getText(n))
    return u''.join(L)
Get all the text associated with this node.
       With recursive == True, all text from child nodes is retrieved.