@Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
        currentElement = "";
        level--;
        if (localName.compareTo("service")==0){
            if (device.getServiceTypeCIF() != null &&
                    device.getServiceTypeCIF().compareTo("urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1") == 0)
                state = 2;
            if (device.getServiceType() != null &&
                    device.getServiceType().compareTo("urn:schemas-upnp-org:service:WANIPConnection:1") == 0)
                state = 3;
        }
    }