When you say "speed sensor," what are you referring to? As I recall, the AW4 has two (someone correct me if I am wrong, and this is on earlier XJ...)
There is one in the transfer case adapter housing (on 4WD) that is a Hall effect sensor, which basically reports that the vehicle is moving and generally what is going on.
The one that actually drives the speedometer is the one in the transfer case rear output housing, and is the one with the "speedo drive gear" that you always hear about having to change. Even with an electronic speedometer, you still have the drive pinion gear in the output housing, which can be changed to reflect changes in tyre size or final drive (axle) ratio.
I find it somewhat reasonable to presume that the Hall effect sensor (if present) may be swapped freely between 2WD and 4WD versions - and I'm almost certain that the speedo drive can be readily swapped without incident (use the proper gear for the adapter housing, there are two shaft lengths as well. I believe the short shaft is for mechanical speedo, and the long shaft for electric.)
You're probably right - I'm about willing to bet this has been done to death in the past. However, it's probably also far enough in the past that I can't recall answering it, so here you go! (If it had been done recently, I'd either offer a few search terms to test your Google-Fu, or just tell you to search it up because I know I'd answered it recently and didn't want to go through it again...)