def childText(node, addTail=False):
    """Return the textContent of an lxml node"""
    if node.text:
        rv = node.text
    else:
        rv = ""
    for child in node:
        child_text = childText(child, True)
        if child_text is not None:
            rv += child_text
    if addTail and node.tail is not None:
        rv += node.tail
    return rv