code: public static boolean isValidXmlChar(int ch)
      {
          return (ch == 0x9)
              || (ch == 0xA)
              || (ch == 0xD)
              || (ch >= 0x20 && ch <= 0xD7FF)
              || (ch >= 0xE000 && ch <= 0xFFFD)
              || (ch >= 0x10000 && ch <= 0x10FFFF);
      }
docs: Returns <code>true</code> if the given value is a valid XML character.
  <p>
  See http://www.w3.org/TR/xml/#charsets
  </p>
  
  @param ch the value to check
  @return <code>true</code> if the given value is a valid XML character.