Revert "Migrate reference handling to XInclude."

This reverts commit f120a71390d15cb77a711404bc10b598e3fa7fdb.