docs: public static void stripWhitespaceNodes(Node element) {
          Node node, child;
          for (child = element.getFirstChild(); child != null; child = node) {
              node = child.getNextSibling();
              stripWhitespaceNodes(child);
          }
  
          if (element.getNodeType() == Node.TEXT_NODE && element.getNodeValue().trim().length()==0) {
              element.getParentNode().removeChild(element);
          }
      }