// create the new XMI resource and add it to model
UmlResource newPmiRes = new UmlResource();
newPmiRes.setName(umlResource.getName().substring(0, umlResource.getName().indexOf(".")));
newPmiRes.setLocation(umlResource.getFullPath().toPortableString());
try {
project.addResource(newPmiRes);
} catch (ResourceException e) {
throw new ExecutionException("Unable to add XMI resource to model.", e);
}
// save the project