public static String encode(String text) {
char c;
StringBuffer n = new StringBuffer();
for (int i = 0; i < text.length(); i++) {
c = text.charAt(i);
switch (c) {
case '&':
{
n.append("&");
break;
}
case '<':
{
n.append("<");
break;
}
case '>':
{