MessageFactoryHelper.createDocumentReplaceAttributes();
if (oldAttributes.isEmpty() && newAttributes.isEmpty()) {
replace.setEmpty(true);
} else {
for (Map.Entry<String, String> e : oldAttributes.entrySet()) {
replace.addOldAttribute(createKeyValuePair(e.getKey(), e.getValue()));
}
for (Map.Entry<String, String> e : newAttributes.entrySet()) {
replace.addNewAttribute(createKeyValuePair(e.getKey(), e.getValue()));
}
}