static void processEntity(String entity, StdXMLReader reader, IXMLEntityResolver entityResolver) throws XMLParseException {
    entity = entity.substring(1, entity.length() - 1);
    Reader entityReader = entityResolver.getEntity(reader, entity);

    if (entityReader == null) {
      errorInvalidEntity(reader.getSystemID(), reader.getLineNr(), entity);
    }

    boolean externalEntity = entityResolver.isExternalEntity(entity);
    reader.startNewStream(entityReader, !externalEntity);
  }
static void processEntity(String entity, StdXMLReader reader, IXMLEntityResolver entityResolver)