Correct XMP output.

Add a unit test for XMP output.
Make the kind of output wanted for the test an enum.