Element () { Element element = new Element("state"); long lastTimeSent = getLastTimeSent(); if (lastTimeSent > 0) { element.setAttribute(LAST_TIME_ATTR, String.valueOf(lastTimeSent)); } if (!isShowNotification()) { element.setAttribute(SHOW_NOTIFICATION_ATTR, "false"); } if (!isAllowedForEAP) { element.setAttribute(IS_ALLOWED_EAP_ATTR, "false"); } for (Map.Entry<String, Long> entry : myRecorderToSystemEventIds.entrySet()) { final Element event = new Element(SYSTEM_EVENT_ATTR); event.setAttribute(RECORDER_ATTR, entry.getKey()); event.setAttribute(EVENT_ID_ATTR, String.valueOf(entry.getValue())); element.addContent(event); } return element; }