Your XD is fully capable of shooting accurately out to 50 yards and beyond, but you have to do your part. To properly find out where your sights are regulated, you'll have to shoot your pistol from a steady rest, such as sand bags or some other support. Shoot each shot using the same grip, trigger squeeze and sight picture (aiming point) and when you get a good group on an area of the target, you'll know where the sights are set for you.
Those of us who used to regularly shoot pistol competitions out to 50 yards get a kick out of all the current "shooters" who say a pistol is only good for 7 to 10 yard shooting. I used to have a target with 10 rounds of .38 Special wadcutters in a 1 7/8" group, fired from a Ransom Rest at 50 yards from my stock S&W K-38. I wish I still had it, but I lost it in a divorce, along with everything else I owned at the time..........
Hope this helps.
Fred