docs: public static String escapeXml(String s) {
          initializeEscapeMap();
  
          if (s == null || s.length() == 0) {
              return s;
          }
  
          char[] sChars = s.toCharArray();
          StringBuilder sb = new StringBuilder();
          int lastReplacement = 0;
          for (int i = 0; i < sChars.length; i++) {
              if (isInvalidXMLCharacter(sChars[i])) {
                  // append intermediate string to string builder
                  sb.append(sChars, lastReplacement, i - lastReplacement);
                  // substitute control character with escape sequence
                  sb.append(sChars[i] == 0xFFFE ? "\\ufffe" : xmlLowValueEscapeStrings[sChars[i]]);
                  // advance last pointer past this character
                  lastReplacement = i + 1;
              }
          }
          if (lastReplacement < sChars.length) {
              sb.append(sChars, lastReplacement, sChars.length - lastReplacement);
          }
  
          return StringEscapeUtils.escapeXml(sb.toString());
      }