Do you have the corresponding xtr/deore derailleurs (M9000 and M5100)? What are the current cassettes on the bikes? I don't think the xtr derailleur will comfortably clear a 51 cog but it can do 46 assuming it's a 1x drivetrain. Best bet would be to get a 11-46 cassette. To swap out a cassette and chain you need a cassette removal tool, a chain whip and assuming the chains have a quick/master link, some master link chain pliers. Best to also have a chain breaker so you can size new chains appropriately.
However, are both bikes at the LBS? I don't quite follow why you need a spare cassette and chain between two bikes?
However, are both bikes at the LBS? I don't quite follow why you need a spare cassette and chain between two bikes?