util.xml: Deduplicate handlers for restricted XML
Makes the code more like util.xmppstream, allowing easier comparisons if
we ever need to apply fixes in the future.
-- Unknown platform stubmodule:set_global();-- TODO Do things that make sense if we don't know about the platform