9mm is WAY cheaper to buy than .40- you can get the Winchester WHite Box 9mm extremely cheap, I've seen it for as little as 4.00 a box of 50 when on sale at Wal-Mart.
Recoil is incredibly subjective to the individual shooter and the guns being used-for example, my little kel-tec p11 recoils to me far more than my dan wesson .357 magnum, simply due to the weight and such.
All the XD's I've ever handled felt like they were MADE for my hand, so I think either caliber would be allright recoil wise....