@SuppressWarnings("unchecked")
        String getComponentsChapter(Collection<Class<?>> comps) {

            StringBuffer db = new StringBuffer();

            // Model component
            db.append("<chapter>");
            db.append("<title>" + b.getString("model") + "</title>");
            Class mai = comps.iterator().next();  // the first component is top.
            db.append(classSection(mai));
            db.append("</chapter>");

            comps.remove(mai);      // remove the main component
            Map<Package, List<Class<?>>> pmap = categorize(comps);
            List<Package> pl = new ArrayList<Package>(pmap.keySet());
            Collections.sort(pl, new Comparator<Package>() {

                @Override
                public int compare(Package o1, Package o2) {
                    return o1.getName().compareToIgnoreCase(o2.getName());
                }
            });

            // Subcomponents.
            db.append("<chapter>");
            db.append("<title>" + b.getString("sub") + "</title>");
            for (Package p : pl) {
                db.append("<section>");
                db.append("<title>'" + p.getName() + "'</title>");
                List<Class<?>> co = pmap.get(p);
                Collections.sort(co, new Comparator<Class<?>>() {

                    @Override
                    public int compare(Class o1, Class o2) {
                        return o1.getSimpleName().compareToIgnoreCase(o2.getSimpleName());
                    }
                });
                for (Class c : co) {
                    db.append(classSection(c));
                }
                db.append("</section>");
            }
            db.append("</chapter>");
            return db.toString();
        }