@Override
    public void endElement(String ns, String localName, String qName)
            throws SAXException {
        if ("http://www.w3.org/1999/xhtml" == ns
                && "template".equals(localName)) {
            numberOfTemplatesDeep--;
            if (numberOfTemplatesDeep != 0) {
                return;
            }
        } else if (numberOfTemplatesDeep > 0) {
            return;
        }
        delegate.endElement(ns, localName, qName);
    }
@throws SAXException
@see org.xml.sax.ContentHandler#endDocument()
src/nu/validator/xml/templateelement/TemplateElementDroppingContentHandlerWrapper.java