I for one have never been a big fan of the .40, if you look in to the .40 the only nation that uses it or has any intrest in it is the US. Military units are now looking at going back to the .45 and with a pistol like the XD45 they will have a great pistol for the future.
People talk about the 9mm being under powered, not a good defensive caliber, yet the Germans, British, and Canadian's have use the 9mm for well over a hundred years not to mention 2 World Wars and a host of bush wars. The Luger and Browning Hi-Power were used ust to name a few.
For me, I have carried the Sig P229 in 9mm for the better part of 10 yrs before I purchased the XD45 about 2 yrs ago. I Love the fact that the XD carries the same numbers of rounds per mag as the Sig
If you choose the 9mm or .45 you can not go wrong. One of the things you must consider is ammo. Surplus 9/.45 ammo is cheaper then ammo for the .40 any given day of the week.