src/main/java/org/jboss/pressgang/ccms/model/utils/TopicUtilities.java
protected static String cleanXMLForMinHash(final String xml) {
        // Treat null and empty strings the same
        final String fixedXML = xml == null ? "" : xml;

        String text = null;
        try {
            final Document doc = XMLUtilities.convertStringToDocument(fixedXML);
            if (doc != null) {
                text = doc.getDocumentElement().getTextContent();
            }
        } catch (final Exception ex) {
            // Do nothing
        }

        // the xml was invalid, so just strip out xml elements manually
        if (text == null) {
            text = fixedXML.replaceAll("</?.*?/?>", " ");
        }

        return text;
    }
protected static String cleanXMLForMinHash(final String xml) {
        // Treat null and empty strings the same
        final String fixedXML = xml == null ? "" : xml;

        String text = null;
        try {
            final Document doc = XMLUtilities.convertStringToDocument(fixedXML);
            if (doc != null) {
                text = doc.getDocumentElement().getTextContent();
            }
        } catch (final Exception ex) {
            // Do nothing
        }

        // the xml was invalid, so just strip out xml elements manually
        if (text == null) {
            text = fixedXML.replaceAll("</?.*?/?>", " ");
        }

        return text;
    }
Cleans the provided XML by removing element names and other useless data.

@param xml The xml to be cleaned.
@return The cleaned xml.