def strip_minidom_whitespace(node):
for child in node.childNodes:<EOL><INDENT>if child.nodeType == Node.TEXT_NODE:<EOL><INDENT>if child.nodeValue:<EOL><INDENT>child.nodeValue = child.nodeValue.strip()<EOL><DEDENT><DEDENT>elif child.nodeType == Node.ELEMENT_NODE:<EOL><INDENT>strip_minidom_whitespace(child)<EOL><DEDENT><DEDENT>
Strips all whitespace from a minidom XML node and its children

    This operation is made in-place.