def gatherTextNodes(iNode, dounescape=0, joinWith=""):
    gathered=[]
    gathered_append=gathered.append
    slice=[iNode]
    while len(slice)>0:
        c=slice.pop(0)
        if hasattr(c, 'nodeValue') and c.nodeValue is not None:
            if dounescape:
                val=unescape(c.nodeValue)
            else:
                val=c.nodeValue
            gathered_append(val)
        slice[:0]=c.childNodes
    return joinWith.join(gathered)
Visit each child node and collect its text data, if any, into a string.
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/web/domhelpers.py/gatherTextNodes