It all depends on what your module's contract is. If it says it's going to produce some HTML in an exact way, then you need to test that exactly, hardcoding, if necessary. If it just says "will produce valid HTML/XML", etc, then you just need to test that.
In your case, I suspect the latter and I would use some other modules to check that the output is a valid form of the desired output (maybe