def METHOD_NAME(node):
    result = []
    def visit(node):
        if node is not None:
            if node.text is not None:
                result.append(node.text)
            for child in node:
                visit(child)
            if node.tail is not None:
                result.append(node.tail)
    visit(node)
    return "".join(result)