} else {
spec = spec.and(SchematronCriteriaGroupSpecs.hasGroupName(groupName));
}
}
Element groups = repository.findAllAsXml(spec);
@SuppressWarnings("unchecked")
final List<Element> records = groups.getChildren(GeonetEntity.RECORD_EL_NAME);
if (!includeCriteria || !includeSchematron) {
for (Element child : records) {