I need to replace a cassette for CS-HG500-10 but want to go XT My bike has a CS-HG500-10 cassette which has reached its EOL after 7400 km (I didn't think that changing the chain, unless absolutely necessary, was something good). It's the 11-34 version, I-CSHG50010134.
https://www.bike-components.de/de/Shimano/Kassette-CS-HG500-10-10-fach-p43864/?o=100330-universal-11-34
Is it possible to replace it with an XT cassette, like the Shimano XT CS-M771-10, I-CSM77110134?
https://www.bike-components.de/de/Shimano/XT-Kassette-CS-M771-10-10-fach-p24985/?o=300330-silber-11-34
Also, could I replace it with an 11-36 version, instead of 11-34, without changing anything else? That would make it a bit easier if I'm on a steep climb, right? Or would it not be beneficial?
Both require the same CN-HG95 chain, which indicates that they're pretty much compatible.
Or would anyone recommend against that switch from CS-HG500-10 to CS-M771-10?
What tools do I need, to be able to replace the old one?

The reason I need to change the cassette is because I replaced the old chain with a new one, and that new one was constantly some sort of jumping when I put a bit stronger pressure on the pedals. At first I thought that I somehow misaligned the gears, because I did a thorough cleaning of the bike on that day, but all the attempts to get that jumping fixed failed. Then I realized that it may be because the length of the new chain was shorter, it may be that the cassette became worn out too much. I had the old chain in my backpack, so I replaced the new one with it and the problem went away.
The chain has 108 segments and this is how they compare in length due to wear:
A Shimano 10-speed MTB cassette is a 10-speed Shimano MTB cassette. There is no functional difference.
The differences will be only in the weight or the durability (the rate of wear) due to different materials.
And some possibly very minor differences in the construction like whether the sprockets are rivetted together or not. Mostly irrelevant to most users.
You can use whichever version you like.

There are many Q/As about changing a cassette here. You need a cassette tool with a wrench and a chain whip. It is pretty simple.
A torque wrench would be a bonus, the required torque range (say 30-50 N.m) is pretty large so can be guessed by feel. It must be pretty tight.