void (Element dataElement, Storage storage) { Iterator<String> keys = ((Storage.MapStorage)storage).getKeys(); while (keys.hasNext()) { String key = keys.next(); String value = storage.get(key); Element element = new Element(ITEM_TAG); element.setAttribute(KEY_ATTR, key); if (value != null) { element.setAttribute(VALUE_ATTR, value); } dataElement.addContent(element); } }