If you still have the "Power/Comfort" switch from the donor vehicle, I'd be inclined to think that it's 1987-1990 vintage. Did it also come with a "divorced" or "separate" transmission control unit, or was it integrated into the engine controller as a single box?
Also, it's quite important that you do manage to nail down the donor's year - at least, whether it's 1990 and earlier, or 1991 and later. You see, those years are also the dividing line for different control systems - from 1987 to 1990, the XJ used a control setup built by Bendix under contract to Renault (called RENIX, here and elsewhere
and 1991 and up XJ used Chrysler control electronics, which began integrating various control functions into a single control unit (typically called a Powertrain Control Module.)
Why is this important? For 1990 and earlier models, the Throttle Position Sensor for AW4-equipped XJ's was actually two units in one - there was a three-wire plug that went to the engine controller, and a four-wire plug (only three wires used) that went to the transmission controller. In 1991, both functions were served by a single sensor, and a single plug. This makes nailing down your donor's era accurately VERY important! If it was from a TJ into your XJ (or a YJ into your XJ,) it would be easier - the YJ didn't get the 4.0/AW4 combination until 1991. However, XJ's were equipped with it as early as 1987 (I know, I have one out back...)
If you brought over all your engine control electronics with the swap, then it's just a matter of identifying the ignition coil (the easiest and most visible way.) 1987-1990 XJ w/4.0L I6 used an ignition coil that was mounted to the ignition control module, and the word "RENIX" was actually cast into the module, between the heatsink fins. 1991-up XJ had a coil that was NOT attached to a control module, since the control module was divorced from the engine (mounted on the firewall, I believe.)
Also, the engine control module itself, for 1987-1990XJ, was found under the dashboard near your right knee (in left-hand drive versions) and usually had the word "RENIX" or "BENDIX" cast or stamped into the module's case.
If that doesn't help, we'll still be able to work with either an engine block casting number or a cylinder head casting number, assuming they're original. 1987-1990 4.0L engines carried a cylinder head with the casting number #2686, and 1991-1995 with #7120. 1996-1999 was usually 0630, and 2000-2001XJ had 0331. I don't recall precisely where the cylinder head casting number is offhand (it's late - perhaps someone else will see this and confirm in the morning over here?) but I believe it is on the driver's side of the cylinder head top, between #3 and #4 cylinders, outside of the valve cover.
While the RENIX (1987-1990) control system is often looked down upon over here, and many are grateful for its replacement with Chrysler's electronics, there are those among us who actually
like the system - I find it easier to troubleshoot, since there isn't an electronic "brain" trying to throw diagnostic codes at me and give me its own ideas.
As far as AW4 tech and information, may I suggest you look up BrettM - he's devised a "manual/automatic" shifter control for the AW4 that's gotten good reviews, and may know more about the box than I do...
5-90