docs: public String toXML()
      {
          RepositoryTags tags = RepositoryTags.getInstance();
          String eol = System.getProperty("line.separator");
  
          // comment on class
          StringBuffer result = new StringBuffer(1024);
          result.append( eol);
          result.append( "  <!-- Mapping for Class ");
          result.append( this.getClassNameOfObject());
          result.append( " -->");
          result.append( eol );
  
          // opening tag and attributes
          result.append( "  ");
          result.append( tags.getOpeningTagNonClosingById(CLASS_DESCRIPTOR));
          result.append( eol );
  
          // class
          result.append( "    ");
          result.append( tags.getAttribute(CLASS_NAME, this.getClassNameOfObject()));
          result.append( eol );
  
          // isolation level is optional
          if (null != getRepository())
          {
              if (getIsolationLevel() != this.getRepository().getDefaultIsolationLevel())
              {
                  result.append( "    ");
                  result.append( tags.getAttribute(ISOLATION_LEVEL, this.isolationLevelXml()) );
                  result.append( eol );
              }
          }
  
          Class theProxyClass = null;
          try
          {
              theProxyClass = this.getProxyClass();
          }
          catch (Throwable t)
          {
              // Ignore this exception, just try to get the Class object of the
              // proxy class in order to be able to decide, whether the class
              // is a dynamic proxy or not.
          }
  
          // proxy is optional
          if (theProxyClass != null)
  	{
  	    if (isDynamicProxy())   // tomdz: What about VirtualProxy ?
              {
          	result.append( "    ");
                  result.append( tags.getAttribute(CLASS_PROXY, DYNAMIC_STR));
                  result.append( eol );
      	    }
              else
  	    {
      	        result.append( "    ");
              result.append( tags.getAttribute(CLASS_PROXY, this.getProxyClassName()));
              result.append( eol );
              }
              result.append( "        ");
          result.append( tags.getAttribute(PROXY_PREFETCHING_LIMIT, "" + this.getProxyPrefetchingLimit()));
          result.append( eol );
  	}
  
          // schema is optional
          if (this.getSchema() != null)
          {
              result.append( "    ");
              result.append( tags.getAttribute(SCHEMA_NAME, this.getSchema()));
              result.append( eol );
          }
  
          // table name
          if (this.getTableName() != null)
          {
              result.append("    ");
              result.append( tags.getAttribute(TABLE_NAME, this.getTableName()));
              result.append( eol );
          }
  
          // rowreader is optional
          if (this.getRowReaderClassName() != null)
          {
              result.append( "    ");
              result.append( tags.getAttribute(ROW_READER, this.getRowReaderClassName()));
              result.append( eol );
          }
  
          //accept-locks is optional, enabled by default
          if (!this.acceptLocks)
          {
              result.append( "        ");
              result.append( tags.getAttribute(ACCEPT_LOCKS, "false"));
              result.append( eol );
          }
          // sequence manager attribute not yet implemented
  
          // initialization method is optional
          if (this.getInitializationMethod() != null)
          {
              result.append( "    ");
              result.append( tags.getAttribute(INITIALIZATION_METHOD, this.getInitializationMethod().getName()));
              result.append( eol );
          }
  
          // factory class is optional
          if (this.getFactoryClass() != null)
          {
              result.append( "    ");
              result.append( tags.getAttribute(FACTORY_CLASS, this.getFactoryClass().getName()) );
              result.append( eol );
          }
  
          //	factory method is optional
          if (this.getFactoryMethod() != null)
          {
              result.append( "    ");
              result.append( tags.getAttribute(FACTORY_METHOD, this.getFactoryMethod().getName()) );
              result.append( eol );
          }
  
          //reference refresh is optional, disabled by default
          if (isAlwaysRefresh())
          {
              result.append( "    ");
              result.append( tags.getAttribute(REFRESH, "true"));
              result.append( eol );
          }
  
          result.append( "  >");
          result.append( eol );
  
          // end of attributes
  
          // begin of elements
          if (isInterface())
          {
              // extent-class
              for (int i = 0; i < getExtentClassNames().size(); i++)
              {
                  result.append( "      ");
                  result.append( tags.getOpeningTagNonClosingById(CLASS_EXTENT));
                  result.append( " " );
                  result.append( tags.getAttribute(CLASS_REF, getExtentClassNames().get(i).toString()) );
                  result.append( " />");
                  result.append( eol );
              }
          }
          else
          {
              // class extent is optional
              if (isExtent())
              {
                  for (int i = 0; i < getExtentClassNames().size(); i++)
                  {
                      result.append( "      ");
                      result.append( tags.getOpeningTagNonClosingById(CLASS_EXTENT));
                      result.append( " " );
                      result.append( tags.getAttribute(CLASS_REF, getExtentClassNames().get(i).toString()) );
                      result.append( " />");
                      result.append( eol );
                  }
              }
  
              // write all FieldDescriptors
              FieldDescriptor[] fields = getFieldDescriptions();
              for (int i = 0; i < fields.length; i++)
              {
                  result.append( fields[i].toXML() );
              }
  
              // write optional ReferenceDescriptors
              Vector refs = getObjectReferenceDescriptors();
              for (int i = 0; i < refs.size(); i++)
              {
                  result.append( ((ObjectReferenceDescriptor) refs.get(i)).toXML() );
              }
  
              // write optional CollectionDescriptors
              Vector cols = getCollectionDescriptors();
              for (int i = 0; i < cols.size(); i++)
              {
                  result.append( ((CollectionDescriptor) cols.get(i)).toXML() );
              }
  
              // write optional IndexDescriptors
              for (int i = 0; i < indexes.size(); i++)
              {
                  IndexDescriptor indexDescriptor = (IndexDescriptor) indexes.elementAt(i);
                  result.append( indexDescriptor.toXML() );
              }
  
              // Write out the procedures
              if (this.getInsertProcedure() != null)
              {
                  result.append( this.getInsertProcedure().toXML() );
              }
              if (this.getUpdateProcedure() != null)
              {
                  result.append( this.getUpdateProcedure().toXML() );
              }
              if (this.getDeleteProcedure() != null)
              {
                  result.append( this.getDeleteProcedure().toXML() );
              }
          }
          result.append( "  ");
          result.append( tags.getClosingTagById(CLASS_DESCRIPTOR) );
          return result.toString();
      }