docs: public String toXML()
      {
          RepositoryTags tags = RepositoryTags.getInstance();
          String eol = SystemUtils.LINE_SEPARATOR;
  
          // write opening tag
          String result = "      " + tags.getOpeningTagNonClosingById(COLLECTION_DESCRIPTOR) + eol;
  
          // write attributes
          // name
          result       += "        " + tags.getAttribute(FIELD_NAME,this.getAttributeName()) + eol;
  
          // collection class is optional
          if (getCollectionClassName() != null)
          {
              result       += "        " + tags.getAttribute(COLLECTION_CLASS,this.getCollectionClassName()) + eol;
          }
  
          // element-class-ref
           result       += "        " + tags.getAttribute(ITEMS_CLASS,this.getItemClassName()) + eol;
  
          // indirection-table is optional
          if (isMtoNRelation())
          {
               result += "        " + tags.getAttribute(INDIRECTION_TABLE,getIndirectionTable()) + eol;
          }
  
          // proxyReference is optional, disabled by default
          if (isLazy())
          {
              result       += "        " + tags.getAttribute(PROXY_REFERENCE,"true") + eol;
              result       += "        " + tags.getAttribute(PROXY_PREFETCHING_LIMIT, "" + this.getProxyPrefetchingLimit()) + eol;
          }
  
          //reference refresh is optional, disabled by default
          if (isRefresh())
          {
               result       += "        " + tags.getAttribute(REFRESH,"true") + eol;
          }
  
          //auto retrieve
          result += "        " + tags.getAttribute(AUTO_RETRIEVE, "" + getCascadeRetrieve()) + eol;
  
          //auto update
          result += "        " + tags.getAttribute(AUTO_UPDATE, getCascadeAsString(getCascadingStore())) + eol;
  
          //auto delete
          result += "        " + tags.getAttribute(AUTO_DELETE, getCascadeAsString(getCascadingDelete())) + eol;
  
          //otm-dependent is optional, disabled by default
          if (getOtmDependent())
          {
              result += "        " + tags.getAttribute(OTM_DEPENDENT, "true") + eol;
          }
  
          // close opening tag
          result       += "      >" + eol;
  
          // write elements
           // inverse fk elements
          for (int i=0;i<getForeignKeyFields().size();i++)
          {
          Object obj = getForeignKeyFields().get(i);
          if (obj instanceof Integer)
          {
                  String fkId = obj.toString();
              result += "        " + tags.getOpeningTagNonClosingById(INVERSE_FK) + " ";
                  result += tags.getAttribute(FIELD_ID_REF, fkId) + "/>" + eol;
          }
          else
          {
                  String fk = (String) obj;
              result += "        " + tags.getOpeningTagNonClosingById(INVERSE_FK) + " ";
                  result += tags.getAttribute(FIELD_REF, fk) + "/>" + eol;
          }
          }
  
          // write optional M:N elements
          // m:n relationship settings, optional
          if (isMtoNRelation())
          {
              // foreign keys to this class
               for (int i=0;i<getFksToThisClass().length;i++)
               {
                  String fkId = getFksToThisClass()[i];
                  result += "        " + tags.getOpeningTagNonClosingById(FK_POINTING_TO_THIS_CLASS) + " ";
                  result += tags.getAttribute(COLUMN_NAME, fkId) + "/>" + eol;
               }
  
              // foreign keys to item class
               for (int i=0;i<getFksToItemClass().length;i++)
               {
                  String fkId = getFksToItemClass()[i];
                  result += "        " + tags.getOpeningTagNonClosingById(FK_POINTING_TO_ITEMS_CLASS) + " ";
                  result += tags.getAttribute(COLUMN_NAME, fkId) + "/>" + eol;
               }
          }
  
          // closing tag
          result       += "      " + tags.getClosingTagById(COLLECTION_DESCRIPTOR) + eol;
          return result;
      }