code: @Override
      protected void closeStartElement(boolean emptyElem)
          throws XMLStreamException
      {
          mStartElementOpen = false;
  
          try {
              if (emptyElem) {
                  mWriter.writeStartTagEmptyEnd();
              } else {
                  mWriter.writeStartTagEnd();
              }
          } catch (IOException ioe) {
              throw new WstxIOException(ioe);
          }
  
          if (mValidator != null) {
              mVldContent = mValidator.validateElementAndAttributes();
          }
  
          // Need bit more special handling for empty elements...
          if (emptyElem) {
              SimpleOutputElement curr = mCurrElem;
              mCurrElem = curr.getParent();
              if (mCurrElem.isRoot()) { // Did we close the root? (isRoot() returns true for the virtual "document node")
                  mState = STATE_EPILOG;
              }
              if (mValidator != null) {
                  mVldContent = mValidator.validateElementEnd
                      (curr.getLocalName(), curr.getNamespaceURI(), curr.getPrefix());
              }
              if (mPoolSize < MAX_POOL_SIZE) {
                  curr.addToPool(mOutputElemPool);
                  mOutputElemPool = curr;
                  ++mPoolSize;
              }
          }
      }
docs: Method called to close an open start element, when another
  main-level element (not namespace declaration or attribute)
  is being output; except for end element which is handled differently.
  
  @param emptyElem If true, the element being closed is an empty
  element; if false, a separate stand-alone start element.