List<HeaderDeclaration> exportTemplateDeclarations = parseTemplate(exportTemplate);
List<ExportedPackage> packageExports = new ArrayList<ExportedPackage>();
for (String exportedPackage : partial.getExportedPackages()) {
HeaderDeclaration declaration = findMostSpecificDeclaration(exportTemplateDeclarations, exportedPackage);
ExportedPackage export = result.getExportPackage().addExportedPackage(exportedPackage);
if (declaration != null) {
export.getAttributes().putAll(declaration.getAttributes());
Map<String, String> directives = declaration.getDirectives();
addCommaSeparated(export.getExclude(), directives.get("excluded"));
addCommaSeparated(export.getInclude(), directives.get("include"));
addCommaSeparated(export.getMandatory(), directives.get("mandatory"));
addCommaSeparated(export.getUses(), directives.get("uses"));