Element () { Element element = new Element("state"); if (equals(ourDefaultManager.getValue())) { return element; } for (Map.Entry<String, List<ClientProperty>> entry : myPropertyMap.entrySet()) { Element propertiesElement = new Element(ELEMENT_PROPERTIES); propertiesElement.setAttribute(ATTRIBUTE_CLASS, entry.getKey()); for (ClientProperty prop : entry.getValue()) { Element propertyElement = new Element(ELEMENT_PROPERTY); propertyElement.setAttribute(ATTRIBUTE_NAME, prop.getName()); propertyElement.setAttribute(ATTRIBUTE_CLASS, prop.getValueClass()); propertiesElement.addContent(propertyElement); } element.addContent(propertiesElement); } return element; }