utils: Improve XML escape/unescape
model: Don't assume returnedAddress is non-NULL for copyData

Fixes model::dataContents unit test.