I have an XDm 9mm 3.8 and I have shot an XD (not m) 9mm 4.5. The 4.5 barrel length is on a full frame weapon/slide. The longer slide is a bit heavier, which reduces the felt recoil some. The solid handle (vs. either the magazine extension piece or the short magazine) provides a more stable grip which also helps felt recoil some. "Some" might be a fraction of an inch less scatter in a group. The longer barrel length almost certainly translates into slightly higher muzzle velocity with a corresponding increase in penetration.
If your purpose is home defense, probably the 4.5 would serve you better. If your purpose is concealment, the shorter 3.8 is more easily concealed, especially with the shorter magazine.