code: private void writeParamsToRegistryService(SessionProvider sessionProvider) throws IOException, SAXException,
        ParserConfigurationException, RepositoryException
     {
        Document doc = SecurityHelper.doPrivilegedParserConfigurationAction(new PrivilegedExceptionAction<Document>()
        {
           public Document run() throws Exception
           {
              return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
           }
        });
  
        Element root = doc.createElement(SERVICE_NAME);
        doc.appendChild(root);
  
        Element element = doc.createElement(BACKUP_PROPERTIES);
        setAttributeSmart(element, BACKUP_DIR, backupDir);
        setAttributeSmart(element, DEFAULT_INCREMENTAL_JOB_PERIOD, defIncrPeriod);
        setAttributeSmart(element, FULL_BACKUP_TYPE, fullBackupType);
        setAttributeSmart(element, INCREMENTAL_BACKUP_TYPE, incrementalBackupType);
        root.appendChild(element);
  
        RegistryEntry serviceEntry = new RegistryEntry(doc);
        registryService.createEntry(sessionProvider, RegistryService.EXO_SERVICES, serviceEntry);
     }
docs: Write parameters to RegistryService.
  
  @param sessionProvider
  The SessionProvider
  @throws ParserConfigurationException
  @throws SAXException
  @throws IOException
  @throws RepositoryException