Migrate reference handling to XInclude.