if (elements.isEmpty()) throw new IllegalStateException("no matching start element");
  public void writeEndElement()    throws XMLStreamException  {    try      {        endStartElement();        String[] element = (String[]) elements.removeLast();        namespaces.popContext();        writer.write('<');        writer.write('/');        if (element[0] != null && !"".equals(element[0]))          {            writer.write(element[0]);            writer.write(':');          }        writer.write(element[1]);        writer.write('>');      }    catch (IOException e)      {        XMLStreamException e2 = new XMLStreamException(e);        e2.initCause(e);        throw e2;      }  }