Continuity check - make sure there is continuity (nearly zero resistance) from the case of the oil pressure sender to the battery "-" terminal, and to the sheetmetal (that's the ground reference for sensors that don't report to the ECU - the ones that do have their own ground.)
If you'd mentioned what year your XJ happens to be, I might be able to give you more advice - there were changes to the wiring over the years.
However, I do believe that if you get continuity between the sensor case and the bolt on the upper firewall that retains the ground strap, you should be in good shape. That's the main chassis ground (the chassis is grounded via the engine block and thence to the battery.) It is usually a good idea to add another ground from the battery, going directly to the sheetmetal of the fenderwell - use a fairly stout cable (8 or 10 gage is fine here) and clean the spot of paint before you screw down the cable. Use Ox-Gard to maintain a clean connection. Unless you're building a Formula racing car, there is no suck thing as too many grounds!
It is also worth noting that the braided ground strap picks up crap, grease, and oil over the years - and that will cause a ground strap that looks alright physically to have a rather high resistance - and cause all sorts of strange problems. When the time comes, I replace that thing with a genuine length of cable, with both ends sealed against contamination - cheap insurance.
I think most of those braided ground straps are good for about ten years - TOPS. After that, they're too contaminated to be reliable. Besides, they're usually aluminum - which isn't as good a conductor as you need for something like this (the better ones are tinned copper - better, but the "open" nature of the conductor is still at issue.)
5-90