code: private char getNextExpanded()
          throws XMLStreamException
      {
          while (true) {
              char c = (mInputPtr < mInputEnd) ?
                  mInputBuffer[mInputPtr++] : getNextChar(getErrorMsg());
              if (c != '%') {
                  return c;
              }
              expandPE();
          }
      }
docs: Method that will get next character, and either return it as is (for
  normal chars), or expand parameter entity that starts with next
  character (which has to be '%').