My unqualified, unabashed, ********ed opinion at this moment is:
NEITHER!
They're both ugly as sin.
The Beretta 9000 is 'questionable' in it's reliability, plus it's FAT and a PITA to grip the slide.
The XD-40 is butt-ugly, period. I have no idea how it works in .40.
I WOULD, however, promote the Beretta MiniCougar 'D' I've seen on the internet in 9mm.
It is a 'slickslide' version and is just a helluva good looking pistol.
It is reportedly extremely reliable and 'hot 9mm' might do the trick.
Of course, there are .40's in the 'D' version to be had, but harder to find. That's one I'd look for.
Sorry I don't have a better response for you tonight.