code: def strip_minidom_whitespace(node):
      
      for child in node.childNodes:
          if child.nodeType == Node.TEXT_NODE:
              if child.nodeValue:
                  child.nodeValue = child.nodeValue.strip()
          elif child.nodeType == Node.ELEMENT_NODE:
              strip_minidom_whitespace(child)
docs: Strips all whitespace from a minidom XML node and its children
  
      This operation is made in-place.