public Section map() {
      if (original.getRepository() == null || original.getRepository().toString().isEmpty()) {
         logger.error("Cannot perform mapping procedure on section " + original.toString() +
               "! No repository for terminologies specified!");
      }
      try {
         original.resolveAllLinks();// before start of mapping resolve all
         // links and
         original.loadAllIncludes();// load all external information.
         checkMapping();
         if (mapped == null && original.isRoot()) {// the original Section is
            // a root section...
            mapped = new Section();
            mapped.setDocumentAuthor(original.getDocumentAuthor());
            mapped.setDocumentDate(original.getDocumentDate());
            mapped.setDocumentVersion(original.getDocumentVersion());
         }
         for (int i = 0; i < original.sectionCount(); i++) { // map all
            // subsections
            mapSection(original.getSection(i), mapped);
         }
         mapProperties(original.getRootSection());// map the properties
         mapped.optimizeTree(); // optimize the tree, i.e. remove empty
         // properties and section that may result
         // from loading terminologies etc.
      } catch (Exception e) {
         e.printStackTrace();
      }
      // mapped.optimizeTree();
      return mapped;
   }