final Element element = group.asXml();
element.addContent(new Element("profile").setText(Profile.Administrator.name()));
elGroups.addContent(element);
}
} else {
userGroups = userGroupRepository.findAll(UserGroupSpecs.hasUserId(Integer.valueOf(id)));
for (UserGroup userGroup : userGroups) {
final Element element = userGroup.getGroup().asXml();
element.addContent(new Element("profile").setText(userGroup.getProfile().name()));
elGroups.addContent(element);