public static void readConfigDB() throws Exception {

        try {

            XMLInputFactory inputFactory = XMLInputFactory.newInstance();
            InputStream in = new FileInputStream(configFile);
            if (in.available() == 0) {
                throw(new Exception("File not found or empty"));
            }
            XMLEventReader eventReader = inputFactory.createXMLEventReader(in);

            Map<String, String> newConfig = new HashMap<String, String>();

            while (eventReader.hasNext()) {

                XMLEvent event = eventReader.nextEvent();

                if (event.isStartElement()) {

                    String ConfigSetting = "";
                    if (event.asStartElement().getName().getLocalPart() == ("config") || event.asStartElement().getName().getLocalPart() == ("root")) {
                        event = eventReader.nextTag();

                    }

                    String ConfigKey = event.asStartElement().getName().getLocalPart();
                    event = eventReader.nextEvent();

                    if (event.isEndElement()) {
                        newConfig.put(ConfigKey, null);
                        logger.info("Config: " + ConfigKey + " (not set)");
                    } else {
                        try {
                            ConfigSetting = event.asCharacters().getData();
                            newConfig.put(ConfigKey, ConfigSetting);
                            logger.info("Config: " + ConfigKey + "=" + ConfigSetting);
                        } catch (Exception ex) {
                            logger.warn("Parse error", ex);
                        }
                    }
                }
            }

            setConfigDB(newConfig);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (XMLStreamException e) {
            e.printStackTrace();
        }
    }