Element () { Element metaInfoElement = new Element(META_INFO_ELEMENT); metaInfo.setProperty(META_INFO_MODIFIED_TIME, META_INFO_DATE_FORMAT.format(new Date())); List<String> sortedPropertyNames = new ArrayList<>(metaInfo.stringPropertyNames()); sortedPropertyNames.sort(null); for (String propertyName : sortedPropertyNames) { String value = metaInfo.getProperty(propertyName); Element propertyInfo = new Element(PROPERTY_ELEMENT); propertyInfo.setAttribute(PROPERTY_NAME_ATTR, propertyName); propertyInfo.setText(value); metaInfoElement.addContent(propertyInfo); } return metaInfoElement; }