def tree_text(node):
text = []<EOL>for descendant in walk_dom(node):<EOL><INDENT>if is_text(descendant):<EOL><INDENT>text.append(descendant.nodeValue)<EOL><DEDENT><DEDENT>return '<STR_LIT:U+0020>'.join(text)<EOL>
>>> tree_text(parse_minidom('<h1>one</h1>two<div>three<em>four</em></div>'))
'one two three four'