Both excellent. Neither is my choice.
I have heard from a reliable source (who bought it for his wife, really expecting to love it) that the XD has function problems regarding dirty magazines. If you’re betting your life on it, test it plenty to verify it works slightly dirty. Try to make it fail.
The best advice is to test them both, and buy the one your heart really wants.
I have an XD-40, went out with some friends who are loaders. We put 500 rounds through it in 3 hours, got it dirtier than all get out, didn’t have a single problem with the function of the weapon.
Very accurate weapon from 10 to 20 yards, but then again me and my friends shoot just about every weekend, so most of what I have shoots pretty accurate..