def getTextFromNode(node):
t = "<STR_LIT>"<EOL>for n in node.childNodes:<EOL><INDENT>if n.nodeType == n.TEXT_NODE:<EOL><INDENT>t += n.nodeValue<EOL><DEDENT>else:<EOL><INDENT>raise NotTextNodeError<EOL><DEDENT><DEDENT>return t<EOL>
Scans through all children of node and gathers the
text. If node has non-text child-nodes then
NotTextNodeError is raised.