//get group name:
String groupName = elem.getAttributeValue("name");
if (groupName == null)
throw new IOException("Invalid principal found: missing 'name' attribute");
NamedGroup group = new NamedGroup(groupName);
//members:
List children = elem.getChildren();
Element child;
for (int i=0; i<children.size(); i++) {
child = (Element)children.get(i);
String name = child.getName().toLowerCase();
if (name.equals(this.childName)) {
Principal member = (Principal)principalSerializer.read(child);
group.addMember(member);
}
}
return group;
}