docs: public String toXML()
      {
          RepositoryTags tags = RepositoryTags.getInstance();
          String eol = System.getProperty( "line.separator" );
  
          // opening tag
          StringBuffer result = new StringBuffer( 1024 );
          result.append( "      " );
          result.append( tags.getOpeningTagNonClosingById( REFERENCE_DESCRIPTOR ) );
          result.append( eol );
  
          // attributes
          // name
          String name = this.getAttributeName();
          if( name == null )
          {
              name = RepositoryElements.TAG_SUPER;
          }
          result.append( "        " );
          result.append( tags.getAttribute( FIELD_NAME, name ) );
          result.append( eol );
  
          // class-ref
          result.append( "        " );
          result.append( tags.getAttribute( REFERENCED_CLASS, this.getItemClassName() ) );
          result.append( eol );
  
          // proxyReference is optional
          if( isLazy() )
          {
              result.append( "        " );
              result.append( tags.getAttribute( PROXY_REFERENCE, "true" ) );
              result.append( eol );
              result.append( "        " );
              result.append( tags.getAttribute( PROXY_PREFETCHING_LIMIT, "" + this.getProxyPrefetchingLimit() ) );
              result.append( eol );
          }
  
          //reference refresh is optional, disabled by default
          if( isRefresh() )
          {
              result.append( "        " );
              result.append( tags.getAttribute( REFRESH, "true" ) );
              result.append( eol );
          }
  
          //auto retrieve
          result.append( "        " );
          result.append( tags.getAttribute( AUTO_RETRIEVE, "" + getCascadeRetrieve() ) );
          result.append( eol );
  
          //auto update
          result.append( "        " );
          result.append( tags.getAttribute( AUTO_UPDATE, getCascadeAsString( getCascadingStore() ) ) );
          result.append( eol );
  
          //auto delete
          result.append( "        " );
          result.append( tags.getAttribute( AUTO_DELETE, getCascadeAsString( getCascadingDelete() ) ) );
          result.append( eol );
  
          //otm-dependent is optional, disabled by default
          if( getOtmDependent() )
          {
              result.append( "        " );
              result.append( tags.getAttribute( OTM_DEPENDENT, "true" ) );
              result.append( eol );
          }
  
          // close opening tag
          result.append( "      >" );
          result.append( eol );
  
          // elements
          // write foreignkey elements
          for( int i = 0; i < getForeignKeyFields().size(); i++ )
          {
              Object obj = getForeignKeyFields().get( i );
              if( obj instanceof Integer )
              {
                  String fkId = obj.toString();
                  result.append( "        " );
                  result.append( tags.getOpeningTagNonClosingById( FOREIGN_KEY ) );
                  result.append( " " );
                  result.append( tags.getAttribute( FIELD_ID_REF, fkId ) );
                  result.append( "/>" );
                  result.append( eol );
              }
              else
              {
                  String fk = ( String ) obj;
                  result.append( "        " );
                  result.append( tags.getOpeningTagNonClosingById( FOREIGN_KEY ) );
                  result.append( " " );
                  result.append( tags.getAttribute( FIELD_REF, fk ) );
                  result.append( "/>" );
                  result.append( eol );
              }
          }
  
          // closing tag
          result.append( "      " );
          result.append( tags.getClosingTagById( REFERENCE_DESCRIPTOR ) );
          result.append( eol );
          return result.toString();
      }