spec = Specifications.where(hasGroupSpec);
} else {
spec = spec.and(hasGroupSpec);
}
}
element = criteriaRepository.findAllAsXml(spec);
} else {
final SchematronCriteria criteria = criteriaRepository.findOne(Integer.parseInt(id));
if (criteria == null) {
throw new BadParameterEx(Params.ID, id);