I have done so. My recommendation is to not do so.
Stuff you need to swap over:
- tank
- sending unit
- fill and vent tubes (the rubber ones) to the fill neck
- fuel rail
- fuel supply line from tank to rail
The reason you will need to swap the fuel rail is that the 95 down XJ uses a vacuum FPR on the rail and supply/return lines, while the 96 up XJ uses a returnless system. So you would use a 96-01 rail. Your injectors would work fine.
The problem is, none of the resistance curves on the gauge senders are the same. So your fuel gauge will basically never work again. Further, the 97-01 sender uses a $65 combination check valve, pressure regulator, and filter mounted on top of the sender that requires dropping the tank to get access to it, and it's known for failing and causing hard starts.
Basically the plastic tank is great for not rusting but that's all it has going for it. I did it on my 96 XJ because I had no idea what I was doing at the time and figured a 97 tank would fit a 96 (it's only one year off, right?! :dunce

and didn't want it rusting out either. It was not worth the added hassle. Sorry to poop on your idea, but having done it I'd rather save you the headache than say nothing. The factory tank lasted from '95 till now - by the time the replacement rusts out too, it'll be 2035 and the rest of the XJ will be 40 years old or rusted away to nothing!