try {
if (command.isXML()) {
return project.toXML();
} else if (command.isJSON()) {
return project.toJSON();
} else {
throw new SimalAPIException("Unkown format requested - " + command);
}
} catch (SimalRepositoryException e) {
throw new SimalAPIException("Unable to convert project to the chosen format", e);