I just re-installed my gas tank and put in a new fuel filter, I had to drop the tank to repair rust in the floor of my XJ.
On my '95 XJ, the fuel filter is in the exact spot described, the fuel pump is in the tank, and the wiring for the fuel pump and fuel level sender run out of the tank and along the fuel line, side-by-side, all the way to the fuel filter. Obvisouly the fuel line goes into the fuel filter, the wiring snakes over the filter and goes to a rubber plug into the body (just above the filter and the view of it blocked by the filter) and joins the wire harness inside the XJ.
So they are two different things, (the fuel filter and wiring for the pump/sender), just so close together it can fool you into thinking they are the same.
Even if your older XJ was carburated, with the fuel pump on the motor (some old carb motors still had electric pumps in the tank) the wiring for the fuel level sensor would likely run the same route.