public static String escapeHTMLTags(String in) {
        return escapeHTMLTags(in, true);
    }
This method takes a string which may contain HTML tags (ie, &lt;b&gt;,
&lt;table&gt;, etc) and converts the '&lt;' and '&gt;' characters to
their HTML escape sequences. It will also replace LF  with &lt;br&gt;.

@param in the text to be converted.
@return the input string with the characters '&lt;' and '&gt;' replaced
        with their HTML escape sequences.
xmppserver/src/main/java/org/jivesoftware/util/StringUtils.java