Remove all unnecessary whitespace from a DOM node.