Is changing wheel necessary to use a freewheel with different number of gears?
Despite what others have written, you DO NOT need to match the number of gears on the rear wheel (cassette) to the number of positions on the gear shifters, especially for older shifters.
Many 5, 6 and 7 speed shifters have a "hidden" click, which can thus be used to control the derailleur into the extra position, but conversely, if you are using a 5, 6, 7 or 8 speed cassette with a 9 speed shifter, you will simply not use the 9th position on the shifter.  So long as the end stops on the derailleur are adjusted correctly, so the chain does not fall off the largest or smallest sprocket on the cassette, everything else will be fine.
Some have written very complicated forums and blogs about how Shimano, and others, have changed their design over the last few decades, and you MUST match the shifters to the derailleur to the cassette.
All I can say is that I, like many many others, mix and match whenever we have a need to, and often use 8 or 9 speed shifters and derailleurs with 6, 7 or 8 speed cassettes, with absolutely no issues and perfect shifting.

I currently have a 9-speed cassette on a 1990s MTB with 7 speed shifters; when riding it near home (I live in a flat part of the country) I have it adjusted so I can use gears 3-9 (using positions 1-7 on the shifters) and simply 'forget' about the other two ratios.  When I take it to the hilly parts of the UK I adjust the end stops and take up the slack in the cable so I am using ratios 1-7 on positions 1-7 on the shifters, and 'forget' about the smaller ratios.  This way I have the best of both worlds, with just ten minutes of adjustment between the two, and can source from a much wider range of cassettes, as 8 and 9 speed are still being made by a number of manufacturers, whereas 5, 6 and 7 speed cassettes are not (AFAIK).

Regarding chains, there is some variation: Shimano make chains that are good for 5, 6 and 7 speed systems, and narrower chains for 8 and 9 speed systems (and later really narrow for 10 and 11 speed systems).  However I use SRAM chains and they are compatible with 5-8 speed systems (?) or for 7-9 speed systems (?) suggesting there is some overlap.  Having ridden for over 25 years, around 4000miles a year commuting, leisure and cyclocross, I use SRAM "7-9 speed" chains on all my bikes, whether they have 7, 8 or 9 speed cassettes, and have not had any problems to date.

As you have a bike with XT parts (which some consider to be the best MTB groupset available) you could do a lot worse than stick with an 8-speed system using XT and Dura Ace parts.  I have a Dura Ace equipped road bike ("downgraded" from a 9-speed system for reliability on longer rides) and an XT/XTR equipped all-terrain bike (as I mention above, I do not live in a mountainous area, so it is used on gravel tracks, forestrty commission paths and urban cut-throughs overgrown with stinging nettles and broken glass!) also 8-speed which both give me the same range of gears as from a 9-speed system, but with, so far, 100% reliability after more than 10,000 miles of riding.

As regards "possession of stolen goods"; posting photos on a forum is not the best way to go!  Even if you suggest that you "found" a bicycle or parts, I would not post photos online, as the original owner might take umbrage and want it back.  That said, I "found" a bike over 20 years ago and took it to the police station; they kept it for three months and then let me have it back because the original owner did not come forward to claim it.  I built it into a touring/winter training bike, and have covered about 50,000miles on it, so am happy that I will not be prosecuted, as the police followed procedure for lost/found property and passed it back to me.  Legally I will never be the "owner", but in reality there is no way now for the original owner to prove my bike is their bike and claim it back...

As regards an "XT spec bike" rarely being abandoned; I would invite anyone to come and look around my town.  It is not a "university" town/city, but we have a college and uni campus here, and every week I see £200 and £300 machines abandoned because of a buckled front wheel, broken chain or mangled derailleur.  After a few weeks they are robbed of parts (lights, front wheel if not locked seperately, saddle if quick release, etc.) and then slowly they go rusty and are removed by the council for scrap.  I would hope they would remove them after 3-4 weeks, before they go rusty, store them for the required 3 months, and then donate them to a local recycling charity so they can help those in need in this country or abroad, or else sold to a new buyer with the funds going to help charity.  What this needs is a change in the law to allow "ownership" of anything abandoned for 90-days or more whatever and wherever it is on public land e.g. cars, bicycles, old furniture, etc. provided the police or local authority have seized the goods, checked the details and held them for the requisite period.  We will reduce the amount of bicycles etc. going to landfill or scrap, and help charities and third world countries to become mobile in one go.