static ImportedPackage newImportedPackage (String name, String version, boolean optional) throws InvalidAttributeException {
Map<String, String> attrs = new HashMap<String, String>();
attrs.put(Constants.VERSION_ATTRIBUTE, version);
attrs.put(Constants.RESOLUTION_DIRECTIVE + ":", (optional)?Constants.RESOLUTION_OPTIONAL:Constants.RESOLUTION_MANDATORY);
return new ImportedPackageImpl (name, attrs);
}