I think any BMW after the E36 is going to be expensive to maintain unless you're a decant backyard mechanic who can take the time to cruise the forums. I am a big fan of the E39 series, especially the 540i, GREAT touring car. Prices around here are way down, don't know about where you are. Find one that's been well maintained and be aware of the big issues, cooling system and A-arm bushings (the famous 50 mph shake). The forums know every little niggle on these cars, they even have a list of common problems and fixes. Prices are actually fairly reasonable, BMW and Pelican parts, if you do the work yourself. I loved my 540, a cow to work on but what a car.
X-drive adds unnecessary complexity where you're from, just added stuff to go wrong. I've heard nothing but horror stories about the X3/5, more time at the dealership than driving.