'Saves XML config on new file.'

def saveConfig(self, xml_file='~/.faraday/config/user.xml'):

    ROOT = Element('faraday')
    tree = self._getTree()
    API_CON_INFO_HOST = Element(CONST_API_CON_INFO_HOST)
    API_CON_INFO_HOST.text = self.getApiConInfoHost()
    ROOT.append(API_CON_INFO_HOST)
    API_CON_INFO_PORT = Element(CONST_API_CON_INFO_PORT)
    API_CON_INFO_PORT.text = str(self.getApiConInfoPort())
    ROOT.append(API_CON_INFO_PORT)
    API_RESTFUL_CON_INFO_PORT = Element(CONST_API_RESTFUL_CON_INFO_PORT)
    API_RESTFUL_CON_INFO_PORT.text = str(self.getApiRestfulConInfoPort())
    ROOT.append(API_RESTFUL_CON_INFO_PORT)
    APPNAME = Element(CONST_APPNAME)
    APPNAME.text = self.getAppname()
    ROOT.append(APPNAME)
    AUTH = Element(CONST_AUTH, encrypted='no', algorithm='OTR')
    AUTH.text = self.getAuth()
    ROOT.append(AUTH)
    AUTO_SHARE_WORKSPACE = Element(CONST_AUTO_SHARE_WORKSPACE)
    AUTO_SHARE_WORKSPACE.text = self.getAutoShareWorkspace()
    ROOT.append(AUTO_SHARE_WORKSPACE)
    CONFIG_PATH = Element(CONST_CONFIG_PATH)
    CONFIG_PATH.text = self.getConfigPath()
    ROOT.append(CONFIG_PATH)
    DATA_PATH = Element(CONST_DATA_PATH)
    DATA_PATH.text = self.getDataPath()
    ROOT.append(DATA_PATH)
    DEBUG_STATUS = Element(CONST_DEBUG_STATUS)
    DEBUG_STATUS.text = str(self.getDebugStatus())
    ROOT.append(DEBUG_STATUS)
    DEFAULT_CATEGORY = Element(CONST_DEFAULT_CATEGORY)
    DEFAULT_CATEGORY.text = self.getDefaultCategory()
    ROOT.append(DEFAULT_CATEGORY)
    DEFAULT_TEMP_PATH = Element(CONST_DEFAULT_TEMP_PATH)
    DEFAULT_TEMP_PATH.text = self.getDefaultTempPath()
    ROOT.append(DEFAULT_TEMP_PATH)
    FONT = Element(CONST_FONT)
    FONT.text = self.getFont()
    ROOT.append(FONT)
    HOME_PATH = Element(CONST_HOME_PATH)
    HOME_PATH.text = self.getHomePath()
    ROOT.append(HOME_PATH)
    HOST_TREE_TOGGLE = Element(CONST_HOST_TREE_TOGGLE)
    HOST_TREE_TOGGLE.text = self.getHostTreeToggle()
    ROOT.append(HOST_TREE_TOGGLE)
    HSTACTIONS_PATH = Element(CONST_HSTACTIONS_PATH)
    HSTACTIONS_PATH.text = self.getHsactionsPath()
    ROOT.append(HSTACTIONS_PATH)
    ICONS_PATH = Element(CONST_ICONS_PATH)
    ICONS_PATH.text = self.getIconsPath()
    ROOT.append(ICONS_PATH)
    IMAGE_PATH = Element(CONST_IMAGE_PATH)
    IMAGE_PATH.text = self.getImagePath()
    ROOT.append(IMAGE_PATH)
    LOG_CONSOLE_TOGGLE = Element(CONST_LOG_CONSOLE_TOGGLE)
    LOG_CONSOLE_TOGGLE.text = self.getLogConsoleToggle()
    ROOT.append(LOG_CONSOLE_TOGGLE)
    NETWORK_LOCATION = Element(CONST_NETWORK_LOCATION)
    NETWORK_LOCATION.text = self.getNetworkLocation()
    ROOT.append(NETWORK_LOCATION)
    PERSISTENCE_PATH = Element(CONST_PERSISTENCE_PATH)
    PERSISTENCE_PATH.text = self.getPersistencePath()
    ROOT.append(PERSISTENCE_PATH)
    PERSPECTIVE_VIEW = Element(CONST_PERSPECTIVE_VIEW)
    PERSPECTIVE_VIEW.text = self.getPerspectiveView()
    ROOT.append(PERSPECTIVE_VIEW)
    REPO_PASSWORD = Element(CONST_REPO_PASSWORD)
    REPO_PASSWORD.text = self.getRepoPassword()
    ROOT.append(REPO_PASSWORD)
    REPO_URL = Element(CONST_REPO_URL, type='SVN')
    REPO_URL.text = self.getRepoUrl()
    ROOT.append(REPO_URL)
    REPO_USER = Element(CONST_REPO_USER)
    REPO_USER.text = self.getRepoUser()
    ROOT.append(REPO_USER)
    REPORT_PATH = Element(CONST_REPORT_PATH)
    REPORT_PATH.text = self.getReportPath()
    ROOT.append(REPORT_PATH)
    SHELL_MAXIMIZED = Element(CONST_SHELL_MAXIMIZED)
    SHELL_MAXIMIZED.text = self.getShellMaximized()
    ROOT.append(SHELL_MAXIMIZED)
    LAST_WORKSPACE = Element(CONST_LAST_WORKSPACE)
    LAST_WORKSPACE.text = self.getLastWorkspace()
    ROOT.append(LAST_WORKSPACE)
    COUCH_URI = Element(CONST_COUCH_URI)
    COUCH_URI.text = self.getCouchURI()
    ROOT.append(COUCH_URI)
    COUCH_IS_REPLICATED = Element(CONST_COUCH_ISREPLICATED)
    COUCH_IS_REPLICATED.text = str(self.getCouchIsReplicated())
    ROOT.append(COUCH_IS_REPLICATED)
    COUCH_REPLICS = Element(CONST_COUCH_REPLICS)
    COUCH_REPLICS.text = self.getCouchReplics()
    ROOT.append(COUCH_REPLICS)
    VERSION = Element(CONST_VERSION)
    VERSION.text = self.getVersion()
    ROOT.append(VERSION)
    PLUGIN_SETTINGS = Element(CONST_PLUGIN_SETTINGS)
    PLUGIN_SETTINGS.text = json.dumps(self.getPluginSettings())
    ROOT.append(PLUGIN_SETTINGS)
    OSINT = Element(CONST_OSINT)
    OSINT.text = json.dumps(self.getOsint())
    ROOT.append(OSINT)
    UPDATE_URI = Element(CONST_UPDATEURI)
    UPDATE_URI.text = self.getUpdatesUri()
    ROOT.append(UPDATE_URI)
    TKT_URI = Element(CONST_TKTURI)
    TKT_URI.text = self.getTktPostUri()
    ROOT.append(TKT_URI)
    TKT_APIPARAMS = Element(CONST_TKTAPIPARAMS)
    TKT_APIPARAMS.text = self.getApiParams()
    ROOT.append(TKT_APIPARAMS)
    TKT_TEMPLATE = Element(CONST_TKTTEMPLATE)
    TKT_TEMPLATE.text = self.getTktTemplate()
    ROOT.append(TKT_TEMPLATE)
    self.indent(ROOT, 0)
    xml_file = os.path.expanduser(xml_file)
    ElementTree(ROOT).write(xml_file)
