private String plainToHTML(String source) {
        String strResult = "";
        String sourceText = "";

        Integer srcLen = source.length();

        // Cycle through each input character.
        if (srcLen > 0) {

            for (int i = 0; i < srcLen; i++) {
                sourceText = source.substring(i, i + 1);
                if (sourceText.compareTo("<") == 0) {
                    strResult += "&lt;";
                } else if (sourceText.compareTo(">") == 0) {
                    strResult += "&gt;";
                } else if (sourceText.compareTo("'") == 0) {
                    strResult += "&apos;";
                } else if (sourceText.compareTo("\"") == 0) {
                    strResult += "&quot;";
                } else if (sourceText.compareTo("&") == 0) {
                    strResult += "&amp;";
                } else {
                    strResult += source.substring(i, i + 1);
                }
            }
        }

        return strResult;
    }