To take out the radio, all you have to do is unclip the entire assembly (held in by retaining clips) surrounding the radio, then take out two bolts (forget what size) in the upper right and lower left corners of the radio, and disconnect the radio wiring harnesses, ground wire, and A/M-F/M antenna from the back of the radio. The gray and black plugs on the wiring harness will plug right into the factory gray and black plugs, and then you'll just match your wire colors on the wiring harness that comes with your new radio to the wires coming from the aftermarket-to-factory wiring harness you buy. You'll probably want to use Posi-Products connectors instead of tape (that's what I use... just slide a plastic connector over a wire, connect the two wires together, and then screw on the cap... stays in place better than just tape and can be easily unscrewed rather than shrink connectors or butt connectors if you ever need to make a change in wiring such is to add a component like an amplifier or subwoofer... $5.99 a pack but well worth it). You get the wiring harness and dash kit for FREE when you order an aftermarket radio from Crutchfield... elsewhere it'll cost you about $15.00, give or take, depending on where you buy it all.
When you install an aftermarket radio, you'll need to splice the factory ground wire for the radio into a metal surface on the vehicle to ground the new radio, as the aftermarket-to-factory wiring harness adapters DON'T have a ground connection. You'll also need a plastic dash kit that allows you to slide the aftermarket radio's metal "cage" into it and bend the tabs down to hold it in place, then the screw holes line up with the screw holes that your factory radio bolted onto.
Any aftermarket radio from a brand name (Kenwood, Pioneer, Sony, etc... don't choose a "no-name" aftermarket radio from a company such as Axxera or Dual, as it won't sound as good and when I tried to put a Dual in my old Grand Cherokee ZJ, I couldn't get ANY sound of it whatsoever... ended up putting in a nice Sony A/M-F/M-CD-Aux unit that cost me around $70 at Best Buy... $70 is probably the least amount you'll want to spend to get a quality aftermarket radio) will be better than factory, but you'll want to choose a Single-DIN unit, as the factory radio was DIN-and-Half, and there aren't really any aftermarket radios of that size to choose from (the plastic dash kit will fill the void that the factory radio once took up). I've heard you can do Double-DIN as well in the XJ Cherokees, but you'll need to modify the dash,.and you won't be able to reinstall the factory radio if you wish to take your aftermarket radio with you when you sell your Jeep.
Hope this helps.