It sounds to me as if you're testing too large a chunk of functionality. You're describing integration tests, not unit tests. This is too big to be a "unit".
I'd put in a mock XML generator that captures the data structure you're passing through to the thing that make XML/XHTML. Verify that the data structure you're passing to the XML/XHTML generator is correct. Then, I'd test your XML/XHTML generator completely separately. Those are the "units" involved here.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?