code: public static void replaceBadXmlCharactersBySpace(char[] cbuf, int off, int len) {
          for (int i = off; i < off + len; i++) {
              if (isBadXmlCharacter(cbuf[i])) {
                  cbuf[i] = '\u0020';
              }
          }
      }
docs: Replace bad xml charactes in given array by space
  
  @param cbuf buffer to replace in
  @param off  Offset from which to start reading characters
  @param len  Number of characters to be replaced