Not sure what you were looking at on realoem, but the rear bars are not the same between XI and I. The rear bar for an XI is 20mm, part number 33556751267. The rear bar for an I is 18mm, part number 33551095758, or for an I w/ sports suspension it is 19mm part number 33551094545.
That being said, I would venture to guess that the shape is the same, and you would be able to take a rear sway bar (along with its specific mounting bushings) from an I to an XI and vice-versa. I can confirm the endlinks are the same part number, and so are the brackets that hold the bushings.
For the front sway bar, there are no parts in common between an XI and an I, and I would guess that the shape of the bar is completely different, since the XI's bar has bushings which mount the the XI's subframe, in completely different locations than where the I's bar mounts to.
2003 325xi Black³