code: public static String stripNonValidXMLCharacters(String input) {
  		if (input == null || ("".equals(input)))
  			return "";
  		StringBuilder out = new StringBuilder();
  		char current;
  		for (int i = 0; i < input.length(); i++) {
  			current = input.charAt(i);
  			if ((current == 0x9) || (current == 0xA) || (current == 0xD)
  					|| ((current >= 0x20) && (current <= 0xD7FF))
  					|| ((current >= 0xE000) && (current <= 0xFFFD))
  					|| ((current >= 0x10000) && (current <= 0x10FFFF)))
  				out.append(current);
  		}
  		return out.toString();
  	}
docs: 过滤不可见字符