code: private final void validateChar(int value)
          throws XMLStreamException
      {
          /* 24-Jan-2006, TSa: Ok, "high" Unicode chars are problematic,
           *   need to be reported by a surrogate pair..
           */
          if (value >= 0xD800) {
              if (value < 0xE000) { // no surrogates via entity expansion
                  reportIllegalChar(value);
              }
              if (value > 0xFFFF) {
                  // Within valid range at all?
                  if (value > MAX_UNICODE_CHAR) {
                      reportUnicodeOverflow();
                  }
              } else if (value >= 0xFFFE) { // 0xFFFE and 0xFFFF are illegal too
                  reportIllegalChar(value);
              }
              // Ok, fine as is
          } else if (value < 32) {
              if (value == 0) {
                  throwParseError("Invalid character reference: null character not allowed in XML content.");
              }
              // XML 1.1 allows most other chars; 1.0 does not:
              if (!mXml11 && !mAllowXml11EscapedCharsInXml10
                  && (value != 0x9 && value != 0xA && value != 0xD)) {
                  reportIllegalChar(value);
              }
          }
      }
docs: Method that will verify that expanded Unicode codepoint is a valid
  XML content character.