docs: public void writeToFile(DescriptorRepository repository, ConnectionRepository conRepository, OutputStream out)
      {
          RepositoryTags tags = RepositoryTags.getInstance();
          try
          {
              if (log.isDebugEnabled())
                  log.debug("## Write repository file ##" +
                          repository.toXML() +
                          "## End of repository file ##");
  
  
              String eol = SystemUtils.LINE_SEPARATOR;
              StringBuffer buf = new StringBuffer();
              // 1. write XML header
              buf.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + eol);
  
              buf.append("<!DOCTYPE descriptor-repository SYSTEM \"repository.dtd\" >" + eol + eol);
  //            strReturn += "<!DOCTYPE descriptor-repository SYSTEM \"repository.dtd\" [" + eol;
  //            strReturn += "<!ENTITY database-metadata SYSTEM \""+ConnectionRepository.DATABASE_METADATA_FILENAME+"\">" + eol;
  //            strReturn += "<!ENTITY user SYSTEM \"repository_user.xml\">" + eol;
  //            strReturn += "<!ENTITY junit SYSTEM \"repository_junit.xml\">" + eol;
  //            strReturn += "<!ENTITY internal SYSTEM \"repository_internal.xml\"> ]>" + eol + eol;
  
              buf.append("<!-- OJB RepositoryPersistor generated this file on " + new Date().toString() + " -->" + eol);
  
              buf.append(tags.getOpeningTagNonClosingById(RepositoryElements.MAPPING_REPOSITORY) + eol);
              buf.append("  " + tags.getAttribute(RepositoryElements.REPOSITORY_VERSION, DescriptorRepository.getVersion()) + eol);
              buf.append("  " + tags.getAttribute(RepositoryElements.ISOLATION_LEVEL, repository.getIsolationLevelAsString()) + eol);
              buf.append(">" + eol);
  
              if(conRepository != null) buf.append(eol + eol + conRepository.toXML() + eol + eol);
              if(repository != null) buf.append(repository.toXML());
  
              buf.append(tags.getClosingTagById(RepositoryElements.MAPPING_REPOSITORY));
  
              PrintWriter pw = new PrintWriter(out);
              pw.print(buf.toString());
              pw.flush();
              pw.close();
          }
          catch (Exception e)
          {
              log.error("Could not write to output stream" + out, e);
          }
      }