@SuppressWarnings("unchecked")
    private boolean processEndElement() throws XMLStreamException {
        String name = xmlSR.getLocalName();
        String namespace = xmlSR.getNamespaceURI();
        if (LOG.isTraceEnabled()) {
            LOG.trace("End-tag: " + xmlSR.getName() + " at depth " + currDepth);
        }
        if (namespace == null) {
            String prefix = xmlSR.getPrefix();
            if ("".equals(prefix)) {
                prefix = DEFAULT_NS;
            } 
            if (nameSpaces.get(prefix) != null && 
                !nameSpaces.get(prefix).isEmpty()) {
                namespace = nameSpaces.get(prefix).peek();
            }
        }
        String prefix = xmlSR.getPrefix();
        StringBuilder sb = new StringBuilder();
        sb.append("</");
        if (prefix != null && prefix != "") {
            sb.append(prefix + ":" + name);
        } else {
            sb.append(name);
        }
        sb.append(">");
        //write to finish the end tag before checking errors
        write(sb.toString()); 
        if (!newDoc || !name.equals(recordName) || !((recordNamespace == null && namespace == null) 
          || (recordNamespace != null && recordNamespace
          .equals(namespace)))) {
         // not the end of the record: go look for more nodes
            
            if( currDepth == 1) {
                cleanupEndElement();
            } else {
                removeNameSpaceDecl();
                currDepth--;
            }
            return true;
        }
        if (!useAutomaticId && null == currentId && newDoc) {
            LOG.error("end of record element " + name
                + " with no id found: " + ConfigConstants.AGGREGATE_URI_ID
                + "=" + idName);
            cleanupEndElement();
            return true;
        }

        if (value instanceof Text) {
            ((Text) value).set(buffer.toString());
        } else {
            ((Text)((ContentWithFileNameWritable<VALUEIN>)
                    value).getValue()).set(buffer.toString());
        }  
        cleanupEndElement();
        // end of new record
        return false;
    }
@ SuppressWarnings ( "unchecked" ) private boolean processEndElement ( ) throws XMLStreamException { String name = xmlSR . getLocalName ( ) ; String namespace = xmlSR . getNamespaceURI ( ) ; if ( LOG . isTraceEnabled ( ) ) { LOG . trace ( "End-tag: " + xmlSR . getName ( ) + " at depth " + currDepth ) ; } if ( namespace == null ) { String prefix = xmlSR . getPrefix ( ) ; if ( "" . equals ( prefix ) ) { prefix = DEFAULT_NS ; } if ( nameSpaces . get ( prefix ) != null && ! nameSpaces . get ( prefix ) . isEmpty ( ) ) { namespace = nameSpaces . get ( prefix ) . peek ( ) ; } } String prefix = xmlSR . getPrefix ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( "</" ) ; if ( prefix != null && prefix != "" ) { sb . append ( prefix + ":" + name ) ; } else { sb . append ( name ) ; } sb . append ( ">" ) ; write ( sb . toString ( ) ) ; if ( ! newDoc || ! name . equals ( recordName ) || ! ( ( recordNamespace == null && namespace == null ) || ( recordNamespace != null && recordNamespace . equals ( namespace ) ) ) ) { if ( currDepth == 1 ) { cleanupEndElement ( ) ; } else { removeNameSpaceDecl ( ) ; currDepth -- ; } return true ; } if ( ! useAutomaticId && null == currentId && newDoc ) { LOG . error ( "end of record element " + name + " with no id found: " + ConfigConstants . AGGREGATE_URI_ID + "=" + idName ) ; cleanupEndElement ( ) ; return true ; } if ( value instanceof Text ) { ( ( Text ) value ) . set ( buffer . toString ( ) ) ; } else { ( ( Text ) ( ( ContentWithFileNameWritable < VALUEIN > ) value ) . getValue ( ) ) . set ( buffer . toString ( ) ) ; } cleanupEndElement ( ) ; return false ; }
@return false when the record end-element is found; true when keep going
@throws XMLStreamException