I would buy the .40 just for the fact that its a personal favorite for me, and I would go witht he longer barrel just because it looks a little better in my eyes. But the main thing is get the one you like best.
I have the xDm 3.8 40 and I love it! If I were to be looking for some only for home defense I would get a full size 40. I CC so my 3.8 is perfect for me. Be sure to chose the correct round for personal protection/home defense. I keep my guns loaded with PDX1s.
I struggled with this question myself and decided to go with 9mm for a few reasons. Today you can find very effective ammo in 9mm and practice ammo is cheaper. You need to shoot any gun to become comfortable with it. I serious doubt you will pick 40 over 9mm because it feels better. It's going to have more recoil. You will typically have one or more rounds you can carry and your following up shot will be more likely to hit on target. Being that I can put more rounds on target quicker with 9mm... and have more capacity (in general)... I decided on 9mm.