if (!isName(name)) throw new IllegalArgumentException("illegal Name: " + name);
  public void writeEntityRef(String name)    throws XMLStreamException  {    try      {        endStartElement();        writer.write('&');        writer.write(name);        writer.write(';');      }    catch (IOException e)      {        XMLStreamException e2 = new XMLStreamException(e);        e2.initCause(e);        throw e2;      }  }