Great idea.  I have been thinking of moving this into its own module for a while.  I think it might be better to have an XML module into which we can put stuff relating to xml parsing more generally.  For example, we could have a parser which automatically handles conversion to and from utf-8, so that we don't have to do it manually each time.

So I wonder if this module should be called XML instead of compat.