attributes += attribs.getLength();
    public void appendAttributes(Txn transaction, NodeList attribs)            throws DOMException {    	NodeList duplicateAttrs = findDupAttributes(attribs);    	if(duplicateAttrs != null) {    		removeAppendAttributes(transaction, duplicateAttrs, attribs);    	} else {	        DocumentImpl prevDoc = new DocumentImpl(ownerDocument);	        NodeImplRef last = new NodeImplRef(this);	        NodeImpl lastAttrib = getLastAttribute();	        if (children == 0) {	            // no children: append a new child	            appendChildren(transaction, firstChildID(), last, getPath(), attribs, true);	        }	        else {	            final int level = ownerDocument.getTreeLevel(gid);	            ownerDocument.reindex = level + 1;	            if (lastAttrib != null && lastAttrib.gid == lastChildID()) {	                last.node = lastAttrib;	                appendChildren(transaction, lastChildID() + 1, last, getPath(), attribs, true);	            } else {	                appendChildren(transaction, firstChildID() + 1, last, getPath(), attribs, true);	            }	        }	        ownerDocument.broker.update(transaction, this);	        ownerDocument.broker.reindex(transaction, prevDoc, ownerDocument, null);    	}    }