public static CharSequence escapeForXml(CharSequence input) {
        return escapeForXml(input, XmlEscapeMode.safe);
    }
@Test
    public void testEscapeForXml() {
        assertNull(StringUtils.escapeForXml(null));

        String input = "<b>";
        assertCharSequenceEquals("&lt;b&gt;", StringUtils.escapeForXml(input));

        input = "\"";
        assertCharSequenceEquals("&quot;", StringUtils.escapeForXml(input));

        input = "&";
        assertCharSequenceEquals("&amp;", StringUtils.escapeForXml(input));

        input = "<b>\n\t\r</b>";
        assertCharSequenceEquals("&lt;b&gt;\n\t\r&lt;/b&gt;", StringUtils.escapeForXml(input));

        input = "   &   ";
        assertCharSequenceEquals("   &amp;   ", StringUtils.escapeForXml(input));

        input = "   \"   ";
        assertCharSequenceEquals("   &quot;   ", StringUtils.escapeForXml(input));

        input = "> of me <";
        assertCharSequenceEquals("&gt; of me &lt;", StringUtils.escapeForXml(input));

        input = "> of me & you<";
        assertCharSequenceEquals("&gt; of me &amp; you&lt;", StringUtils.escapeForXml(input));

        input = "& <";
        assertCharSequenceEquals("&amp; &lt;", StringUtils.escapeForXml(input));

        input = "&";
        assertCharSequenceEquals("&amp;", StringUtils.escapeForXml(input));

        input = "It's a good day today";
        assertCharSequenceEquals("It&apos;s a good day today", StringUtils.escapeForXml(input));
    }