code: public void endElement(String uri, String localName, String qName)
  	    throws SAXException {
  	// reduce the depth
  	depth--;
  
  	if (isExcluded()) {
  	    // determine if exclusion ends with us
  	    if (excludedDepth == depth)
  	        excludedDepth = -1;
  
  	    // either way, we have been excluded, so pass nothing through
  	    return;
  	}
  
  	// if we're excepted (for now), include ourselves...
  	if (isAccepted())
  	    getContentHandler().endElement(uri, localName, qName);
  
  	    if (DEBUG) {
  		System.err.println("***   Closing tag: " + localName);
  		System.err.println("***   acceptedDepths.size(): " + acceptedDepths.size());
  		System.err.println("***   last accepted depth: " + ((Integer)acceptedDepths.peek()).intValue());
  		System.err.println("***   depth: " + depth);
  	    }
  
  	// now, back off if we correspond to a "successful" start tag
          if (acceptedDepths.size() > 0 &&
  		(((Integer)acceptedDepths.peek()).intValue()) == depth)
  	    acceptedDepths.pop();
      }
docs: Filter for endElement().