def node_text(node):
if node.text:<EOL><INDENT>result = node.text<EOL><DEDENT>else:<EOL><INDENT>result = "<STR_LIT>"<EOL><DEDENT>for child in node:<EOL><INDENT>if child.tail is not None:<EOL><INDENT>result += child.tail<EOL><DEDENT><DEDENT>return result<EOL>
Needed for things like abstracts which have internal tags (see PMID:27822475)