* @return Element
*/
public Element getXml (IGroupMember gm, Element anElem, CGroupsManagerUnrestrictedSessionData sessionData) {
Document aDoc = sessionData.model;
String nextID;
IEntityGroup entGrp = (IEntityGroup)gm;
Element rootElem = (anElem != null ? anElem : GroupsManagerXML.createElement(ELEMENT_TAGNAME, aDoc, false));
Utility.logMessage("DEBUG", "GroupWrapper::getXml(): START, Element Expanded: " + rootElem.getAttribute("expanded"));
try {
String uid = rootElem.getAttribute("id");
if (Utility.areEqual(uid, "")) {
nextID = GroupsManagerXML.getNextUid();
rootElem.setAttribute("id", nextID);
}
rootElem.setAttribute("key", gm.getKey());
rootElem.setAttribute("entityType",gm.getLeafType().getName());
rootElem.setAttribute("type", gm.getType().getName());
rootElem.setAttribute("editable", String.valueOf(entGrp.isEditable()));
boolean hasMems = gm.hasMembers();
if (!hasMems) {
rootElem.setAttribute("expanded", "false");
}
boolean isGroupExpanded = (Boolean.valueOf(rootElem.getAttribute("expanded")).booleanValue());