Element rootEl = doc.getRootElement();
// Add other tags
for (Map.Entry<String, ActivityData> mapEntry : inputData.entrySet()) {
String displayName = mapEntry.getKey();
ActivityData data = mapEntry.getValue();
// Add new xml element
Element activityDataEl = new Element("activityData");
activityDataEl.setAttribute(new Attribute("activityAlias", data
.getActivityAlias()));
activityDataEl.setAttribute(new Attribute("creationDate", data
.getCreationDate().toString()));
activityDataEl.setAttribute(new Attribute("priority", data
.getPriority().toString()));
activityDataEl.setAttribute(new Attribute("uniqueId", ""
+ data.getUniqueId()));
activityDataEl.setAttribute(new Attribute("displayName",
displayName));
DataReference dataRef = data.getDataReference();
Element dataRefEl = new Element("dataReference");
dataRefEl.setAttribute(new Attribute("referenceClass", dataRef
.getReferenceClass().getName()));
dataRefEl.setAttribute(new Attribute("referenceId", ""
+ dataRef.getReferenceId()));
activityDataEl.addContent(dataRefEl);
for (Map.Entry<String, ActivityData.Entry> indexedEntry : data
.getIndexedEntries().entrySet()) {
String index = indexedEntry.getKey();
ActivityData.Entry entry = indexedEntry.getValue();
Element entryEl = new Element("entry");
entryEl.setAttribute(new Attribute("index", index));