I have one XD 45 mag that rattles. It only happens if the mag is fully loaded, and i can see the round sitting at the eight hole move forward and back. If I tap the mag on my palm primer side down, the rattle continues. If I rap it bullet side down, the rattle stops, but I have to push the top bullet back into the mag a bit. Swapping springs does not stop the rattle.
The eighth bullet down coincides with the beginning of the diamond shaped indent intended to pinch the cartridges in tighter as the approach the lips of the mag. As near as I can figure, if I rap the bullets forward, the case is held by the indent. if I rap them backward, the indent is off the case and is over the bullet with little or no friction to keep it from sliding forward and back until the case contacts the indent or the back of the mag. Apparently the 7th and 9th cartridges are in contacting with each other and their respective sides of the mag, with no contact with the eighth round at all.
In my case the solution is simply to carefully tap the indent in near the eighth cartridge.