A nice dynamic drive for a 4x4 and the 3.0d are good when running right but BMWs are not as robust as people like to think. Got 2 in the family, both 4.4 V8 petrol though.
Besides the swirl flaps, the 3.0D engines commonly on the 5 series tended to blow the fuel systems (about a £1K-3K repair depending on severity). Cooling systems on BMWs in general are not great so be sure that there are no air locks, correct coolant grade and level etc as the basics are correct.
Also, take a look at the interior, I'm a BMW fan, had a few, still got one, but in recent years the interiors have been poor with recycled 2nd rate plastics that you would not expect to find in a Vauxhall Vectra! IMO, a porsche Cayenne is a far superior quality vehicle, range rover Sport TDV6 is decent enough quality wise but very heavy.
How about a wild card, Volvo XC90 D5?