public static String xmlEscape(String string, boolean isAttribute, boolean escapeLowAscii, StringBuilder buffer) {
        return xmlEscape(string, isAttribute, escapeLowAscii, buffer, -1);
    }
Replaces the following:
<ul>
<li>all ascii codes less than 32 except 9 (tab), 10 (nl) and 13 (cr) if
escapeLowAscii is <code>true</code>
<li>ampersand (&amp;)
<li>less than (&lt;)
<li>larger than (&gt;)
<li>double quotes (&quot;) if isAttribute is <code>true</code>
</ul>
with character entities.
vespajlib/src/main/java/com/yahoo/text/XML.java