public void endElement(String uri, String localName, String qName) throws SAXException {
        int tag = getTagIndex(qName);
        if (inOneBoxResult) {
            doOneBoxResult(tag);
        } else if (inOneBoxResponse) {
            doOneBoxResponse(tag);
        } else if (inResult) {
            doResult(tag);
        } else if(inNavigationResult){
            doNavigationResult(tag);
        } else if(inNavigationResponse){
            doNavigationResponse(tag);
        } else if (inResponse) {
            doResponse(tag);
        } else if (inSpelling) {
            doSpelling(tag);
        } else if (inSynonyms) {
            doSynonym(tag);
        } else if (inKeymatchResults) {
            doKeymatch(tag);
        } else { // in <GSP>
            doTopLevel(tag);
        }
    }