Check for markup equivalence, not string match

This gets around the issue of different versions of libxml generating subtly
different whitespace/newline output.
Merge pull request #1899 from alphagov/make-tests-more-robust

Check for markup equivalence, not string match