code: public void writeEntityRef(String name) throws XMLStreamException {
  		if (preserveDTD) {
  			try {
  				this.checkPendingATEvents();
  				encoder.encodeEntityReference(name);
  			} catch (Exception e) {
  				throw new XMLStreamException(e.getLocalizedMessage(), e);
  			}
  		}
  	}
docs: /*
  Writes an entity reference
  
  (non-Javadoc)
  
  @see javax.xml.stream.XMLStreamWriter#writeEntityRef(java.lang.String)