Element () { synchronized (mySettingsMap) { Element state = new Element("state"); if (mySettingsMap.isEmpty()) { return state; } SkipDefaultValuesSerializationFilters filter = new SkipDefaultValuesSerializationFilters(); for (String name : mySettingsMap.keySet()) { Element child = XmlSerializer.serializeIfNotDefault(mySettingsMap.get(name), filter); if (child != null) { child.setName("object"); child.setAttribute("language", name); state.addContent(child); } } return state; } }