Yes, I am sure the TPS will work. I am an engineer and know what engineers do to make life easier. You do not want to have a different connector on the throttle body which is dependent on which transmission is attached to the engine.
I was having problems finding a picture of the automatic trans TPS. Go to partsamerica.com and look up the TPS for your XJ. They have a picture of the TPS so you can verify the connector on your TPS is also present on the one in the picture.
Also I'd recommend you start a sensor replacement program. I changed every sensor which is used to run the engine. They degrade over time. I will say every time I changed a sensor the engine ran just a little bit better.
If you choose to do the sensor replacement program. I recommend you next change the Manifold abs pressure (MAP) sensor and then the inlet air temp sensor. When checking prices do not overlook the dealer, I purchased my stuff from the dealer or rockauto.com.
Other things to consider for the future - you have a choice of normal or high altitude. they cost the same at the dealer and with the high alt you get more advance. More advance is not a problem since you have knock sensor.
* crankshaft position sensor
* Idle air controller (IAC)
* Knock sensor
* Coolant temp sensor - this is a hard one, do it last or when changing coolant.
* Ignition coil and Ignition coil module
* engine computer - got a rebuilt one
* Distributor - the bushings wear and will retard your timing, also the cam shaft pos sensor, also known as the sync sensor, is in the ditributor. this sensor tells the injectors to shoot fuel
Also if you still the the metal fuel injectors you need to change them out. They are known for leaking at the seam between the metal and plastic portion. If you do this you should change the pressure regulator while you have it apart. Also you need to the the fuel line coupling repair kit at the dealer, you will need 2 of them and they run $15 each.
Hope that helps!