RE: 9mm vs. .40 S&W
Just out of curiousity, if you are familiar with revolvers, why do you wish to switch to a semi-auto? I'm certainly not knocking semi-auto's as my backup home defense gun is my Glock 21. But if you are already comfortable with a double action revolver and can shoot it well, then there really is no better handgun round for defense than the .357 magnum. The added bonus of course is the ability to shoot cheap .38 special ammo at the range but keep full throttle .357mag's in it defense.
As for your question, for a full size pistol like the 4" XD I'd definately go with .40S&W over 9mm. I'd only suggest 9mm for someone if recoil were a major issue, or if it were for a light weight sub-compact pistol for deep concealment. 9mm is a decent round if loaded with premium ammo, but the .40S&W is definately better. Now, I personally prefer the good old tried-and-true .45ACP for a full sized pistol. I'm not sure if I'd want a compact or sub-compact in .45ACP, however.
Mike