public static void writeHostSettingsToXML(String filename) {
        validateApplicationDirectory(appDirectory);
        
        try (PrintWriter writer = new PrintWriter(appDirectory + "/" + filename, "UTF-8")) {            
            writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            writer.println("<config>\n");
                writer.println("\t<param name=\"" + PARAMS_SSH_ITEM_NAME + "\">");                
                if ((HostSettings.getInstance().getSSHTerminal()!= null) && (!HostSettings.getInstance().getSSHTerminal().equals(""))) {
                    writer.println("\t\t<terminal>" + HostSettings.getInstance().getSSHTerminal() + "</terminal>");
                }
                if ((HostSettings.getInstance().getSSHTerminal()!= null) && (!HostSettings.getInstance().getSSHTerminal().equals(""))) {
                    writer.println("\t\t<size>" + HostSettings.getInstance().getSSHTerminalSize()+ "</size>");
                }
                if ((HostSettings.getInstance().getSSHTerminalFont()!= null) && (!HostSettings.getInstance().getSSHTerminalFont().equals(""))) {
                    writer.println("\t\t<font>" + HostSettings.getInstance().getSSHTerminalFont() + "</font>");
                }
                writer.println("\t</param>\n");
                
                writer.println("\t<param name=\"" + PARAMS_SCREEN_ITEM_NAME + "\">");
                List<String> currentAvailableResolutions = HostSettings.getInstance().getResolutions();
                for (String resolution : currentAvailableResolutions) {
                    writer.println("\t\t<resolution>" + resolution + "</resolution>");
                }
                writer.println("\t</param>\n");
            writer.println("</config>");
        } catch (FileNotFoundException | UnsupportedEncodingException ex) {
            Logger.getLogger(ConnectionDialog.class.getName()).log(Level.SEVERE, null, ex);
        }
    }