I think that this would be possible, although you will have to cut the required notch(es) in to the XD mags to match the beretta holes. Beretta mags will work in an XD, although you have to make a little hole in the front of the mag. That is where the XD catch is. I believe that the Beretta mags have a side notch.
It should work, just measure three times and cut once.
Auto