for (Iterator i = classes.iterator(); i.hasNext(); ) {
packages.add(((XClass) i.next()).getContainingPackage());
}
XPackage currentPackage = null;
for (Iterator packageIterator = packages.iterator(); packageIterator.hasNext(); ) {
currentPackage = (XPackage) packageIterator.next();
setCurrentPackage(currentPackage);
File oldDestDir = getDestDir();
File dir = new File(getDestDir(), PackageTagsHandler.packageNameAsPathFor(currentPackage));
setDestDir(dir);
setTemplateURL(getClass().getResource("resources/classes-list.xdt"));
setDestinationFile("classes-list.html");
startProcess();
classes = currentPackage.getClasses();
setTemplateURL(getClass().getResource("resources/class-details.xdt"));
for (Iterator i = classes.iterator(); i.hasNext(); ) {
setCurrentClass((XClass) i.next());
setDestinationFile(getCurrentClass().getName() + "-details.html");
startProcess();