private void mapSection(Section origin, Section mappedParent) throws Exception {
      Section dest = null; // the destination
      if (origin.getMapping() == null) {// no mapping information could be
         // found just create a copy
         dest = new Section(origin.getName(), origin.getType());
         dest.setDefinition(origin.getDefinition());
         dest.setReference(origin.getReference());
      } else {// there is mapping information
         URL url = origin.getMapping(); // get the mapping
         String destType = url.getRef(); // find the reference part, i.e. the
         // part following the '#' which is
         // the destination type

         if (destType != null && !destType.isEmpty()) { // there is a
            // destination type;
            // load terminology
            dest = TerminologyManager.instance().loadTerminology(origin.getMapping(), destType);
            dest.setName(origin.getName());
            dest.setReference(origin.getReference());
         } else {// there is no type definition: try if an assignment can be
            // uniquely made.
            dest = TerminologyManager.instance().loadTerminology(origin.getMapping(), null);
            if (dest.getSections().size() == 1) {// yes, only one type
               // defined in the
               // terminology, use it!
               dest = dest.getSection(0);
               dest.setName(origin.getName());
               dest.setReference(origin.getReference());
            } else {// error, not unique, raise an error
               logger
                     .error("\tMapper.mapSection(): cannot uniquely map section: "
                           + origin.getName()
                           + ". Section skipped! Extend the desired section type to the mapping url as reference (#someType)");
               dest = null;
            }
         }
      }
      if (mappedParent == null) {// if there is no section so far
         mappedParent = dest;
         forwardMap.put(origin.getPath(), dest.getPath());
         reverseMap.put(dest.getPath(), origin.getPath());
      } else {// otherwise add it
         mappedParent.add(dest);
         forwardMap.put(origin.getPath(), dest.getPath()); // take a note of
         // the origin.
         reverseMap.put(dest.getPath(), origin.getPath());// reverse map (not
         // used, so far)
      }
      for (int i = 0; i < origin.sectionCount(); i++) {// recursively map all
         // subsections.
         mapSection(origin.getSection(i), dest);
      }
   }