code: public static Document getWhitespaceStrippedDocument(Document forDoc) {
          String factory = getTransformerFactory().getClass().getName();
          if (XSLTConstants.JAVA5_XSLTC_FACTORY_NAME.equals(factory)) {
              return stripWhiteSpaceWithoutXSLT(forDoc);
          } else {
              return stripWhiteSpaceUsingXSLT(forDoc);
          }
      }
docs: Returns a new Document instance that is identical to the one
  passed in with element content whitespace removed.
  
  <p>Will use {@link #getStripWhitespaceTransform
  getStripWhitespaceTransform} unless we are operating under the
  severly broken XSLTC Transformer shipping with JDK 1.5.</p>