code: public static String encode(final String input) {
  		if (input == null || input.length() == 0) {
  			return input;
  		}
  		return ENCODE.translate(input);
  	}
docs: Encode all the special characters found in the given string to their escape sequences according to the XML
  specification, and returns the resultant string. Eg. "cat&amp;dog &gt; ant" becomes "cat&amp;amp;dog &amp;gt;
  ant".
  
  @param input the String to encode
  @return an encoded copy of the input String.