Element successfulElement = doc.createElement("successful-bills");
importElement.appendChild(successfulElement);
for (Map<RawBill, String> billMap : failedBills) {
for (Entry<RawBill, String> entry : billMap.entrySet()) {
Element billRawElement = (Element) entry.getKey().toXml(
doc, new XmlTree("registerReads").put("type"));
failedElement.appendChild(billRawElement);
billRawElement.appendChild(new MonadMessage(entry
.getValue()).toXml(doc));
}
}
for (RawBill billRaw : successfulBills) {
successfulElement.appendChild(billRaw.toXml(doc, new XmlTree(
"registerReads").put("type")));
}
}
for (String message : messages) {
importElement.appendChild(new MonadMessage(message).toXml(doc));