Let the user take care of passing something valid and throw an Exception on failure or turn the DOM warning into an Exception and try to handle that (possibly width tidy or a callback), instead of using tidy regardless of what the input is.
I second that.

Posted by Pádraic Brady (padraic) on 2010-04-29T07:44:36.000+0000

Resolved in r22054.

I'll investigate a more robust solution in time for ZF 2.0 and experiment with a better cleanup approach. I'll also build in options to disable the Tidy stage (or remove it completely unless warranted/can report on a fail with a consistently helpful message).