Actually, the first thing to fail...
If you read a lot of these forums, autobox problems on older BMWs are usually the end of the line for these cars.
It is not that there is a "defect" in the transmission, but that, like anything else, they wear out (150K miles is about design life).
Earlier X5s used a GM Hydromatique du France transmission (I saw this when I was at the Zentrum, on the assembly line). It is a GM box, made overseas, with the dipstick removed.
A common failure mode is due to leaks, either in the tailshaft or selector shaft, causing the unit to low low on fluid. Once low on fluid, the torque converter churns and foams the fluid, which overheats, and then turns a burnt brown. At this point, the fluid loses all lubricity and complete transmission failure occurs shortly thereafter.
A dipstick would be helpful in monitoring fluid level and condition, but of course, there isn't one.
Look for a used transmission from a wrecked X5 - a lot cheaper than a rebuilt or new one. And find an independent mechanic to install it - a lot cheaper than the dealer.
And if you own an autobox and feel that it is slipping - RUN do not walk, to a mechanic to get the fluid level checked.
And changing the fluid - even "lifetime" fluids (lifetime = 150,000 miles, not YOUR lifetime) is a good idea, I think.
Sorry to hear about it, but that is a respectable lifetime for any automatic. Not all dogs live to be 14.
Yes, some cars go to 200,000 miles, even 300,000 miles. But these are the exception, not the rule. And often these are highway miles cars that have 100K on the clock in the first three years of use. 150K is more of a realistic lifespan for most modern cars.
There is an "end game" to any vehicle, usually when the repair cost exceeds the book value (which, at $6000, you are getting close to).
Autobox failures will send many X5s to the boneyard. Overheating incidents will kill off others. And accidents will take out the remainder.
The 5-speed manuals are very robust in these cars, although eventually one does have to replace the clutch. I do not own any BMW automatics, nor do I think I would ever buy one.