Add forgotten unit-tests for XML formatting

A follow-up for #131 extracting the relevant part of 30cf85f3a6d31f5da65a07adbba5931d9db9be12 into a standalone commit.