error("literal may not contain entity reference");
{ reset(); c = '&'; } else {
  private String readLiteral(int flags)    throws IOException, XMLStreamException  {    boolean saved = expandPE;    char delim = readCh();    if (delim != '\'' && delim != '"')      error("expected '\"' or \"'\"", new Character(delim));    buf.setLength(0);    if ((flags & LIT_DISABLE_PE) != 0)      expandPE = false;    boolean entities = false;    for (char c = literalReadCh(); c != delim; c = literalReadCh())      {        switch (c)          {          case '\n':          case '\r':            if ((flags & (LIT_ATTRIBUTE | LIT_PUBID)) != 0)              c = ' '; // normalize to space            break;          case '\t':            if ((flags & LIT_ATTRIBUTE) != 0)              c = ' '; // normalize to space            break;          case '&':            mark(2);            c = readCh();            if (c == '#')              {                if ((flags & LIT_DISABLE_CREF) != 0)                  error("literal may not contain character reference");                mark(1);                c = readCh();                boolean hex = (c == 'x');                if (!hex)                  reset();                char[] ref = readCharacterRef(hex ? 16 : 10);                for (int i = 0; i < ref.length; i++)                  {                    c = ref[i];                    if ((flags & (LIT_ATTRIBUTE | LIT_PUBID)) != 0 &&                        (c == '\n' || c == '\r'))                      c = ' '; // normalize                    else if ((flags & LIT_ATTRIBUTE) != 0 && c == '\t')                      c = ' '; // normalize                    buf.append(c);                  }                entities = true;                continue;              }            else              {                if ((flags & LIT_DISABLE_EREF) != 0)                  error("literal may not contain entity reference");                reset();                if (replaceERefs || (flags & LIT_NORMALIZE) > 0)                  {                    String entityName = readNmtoken(true);                    require(';');                    String text = (String) PREDEFINED_ENTITIES.get(entityName);                    if (text != null)                      buf.append(text);                    else                      expandEntity(entityName);                    entities = true;                    continue;                  }                else                  error("parser is configured not to replace entity " +                        "references");              }            break;          case '<':            if ((flags & LIT_ATTRIBUTE) != 0)              error("attribute values may not contain '<'");            break;          }        buf.append(c);      }    expandPE = saved;    if (entities)      normalizeCRLF();    if ((flags & LIT_NORMALIZE) > 0)      normalize();    return buf.toString();  }