Hinge-not
The hinges on the XJ doors are notorious for having issues. The sheetmetal can bend or break, the hinge-pins can wear, and the above-mentioned dirt and debris won't help any of this. It is more prevalent on the two-door model than the four-door model, but all can have problems. There was a redesign of the hinge for '98-'01 and it seems to have helped with the four-doors, but the two-doors still have issues. Of course, keeping dirt away from the hinges will help you, but there are still other things you can do.
Prevention: Pay attention when getting in and out of the Jeep not to use the door for leverage. Don't lean on the doors when they are open either.
Cure: If your hinge is pulling away from the sheet metal, open the door, get all the body sealer out from around the hinge, and then weld the body-side of the hinge to the Jeep. If the hinge pin is loose in the hinge itself, remove the hinge and door from the vehicle. Like any other automotive door hinge, you can drill the old pin out and upsize the pin. There are enough XJs in junkyards that you can just pick up some new-to-you hinges from a junkyard.
Like a Wrangler
The heading for this sidebar is a bit misleading. The Wranglers of the era actually borrow a lot of things with the XJ. For example, the TJ's front suspension design wasn't a Chrysler thing. AMC figured it out way back in '82-'83. The XJ also shares many drivetrain components with the corresponding year Wrangler. All of the advice that pertains to the steering linkage, control arms, unit bearings, ball joints, and exhaust leaks are things shared with the Wrangler. If your XJ is one those with the CAD, the fixes are the same as the YJ Wrangler. Check out articles "Ten for TJ" (page 20) and "Square Problems" (page 32) in this issue for more possible drivetrain-specific issues.