Either is legal for IDPA. The majority, but not all, people prefer a 5" barrel.
Whichever you have, bring it.
If you haven't bought a gun yet, you might want to know that a quirk in the IDPA rules puts the XD in Enhanced Service Pistol Division. The Glocks and S&W M&Ps are among the popular pistols in Stock Service Pistol Division.
http://www.idpa.com/
Few questions not to hijack but am curious.
The 9mm xd being in ESP will need to meet the power floor of 165000?
I reload my target ammo and carry an xd 40 SC. I have a feeling i will need to rework my load to meet the power floor. Where can i chrono to see where i am at?
What makes the xd fall into that category?
Are their paddle holsters and mag holders legal for local competition?
A friend of mine is interested in shooting as well but he has a Regent 45. I assume he will be competing in the same class?