XML: schemas.c: implement & employ full round-trip apply_upgrade
Here, "full round-trip" means upgrade is possibly preceded with
"upgrade-enter" transformation and followed with "upgrade-leave" one.
This is meant to simplify considerations at the side of the "upgrade"
stylesheets, currently upgrade-2.10.xsl in particular, which cannot
cope with "id-ref" occurrences on its own safely and/or reliably
and/or handily. Also, for good measure, keep an eye on this newly
added apply_upgrade function in addition to it's immediate call chain
that was under observation in cts-cli (test_validity) already.
Forward note wrt. upgrade-2.10.xsl:
- "upgrade-enter" part is straightforward and easy: expand id-ref aliases of the upgrade-2.10-affected elements with easy-to-match-later-on id's
- "upgrade-leave" part is just straightforward, but not too difficult either: with each element matched with predefined prefix, find it's original counterpart, serialiaze both elements deterministically (sans id/id-ref) and compare these strings, when matching, turn the exploded one back to the reference to original