There are 3 basic engine families in these trucks, the Lima (2.3, 2.0, 2.5), the Cologne (2.8 , 2.9, 4.0) and the Vulcan (3.0)
4 Basic engine families, the 4th would be 2.3L Duratech.
2001 was a transition year for both the 4 cylinders and 4.0Ls in Rangers. The 4 cylinder moved from a 2.5L Lima, to a 2.3L Duratech. The 4.0L moved from the OVH to the SOHC.
Other than that I'd agree with most of what Brian said other than thinking he was wondering a bit much fron the 2001 engine selections, the 4.0L OHV and 2.9L were history at that point.
First I wouldn't even consider the 3.0L to be a viable swap, unless you already had a totaled, but otherwise good, 3.0L donor sitting in the yard. The was only about 10 HP and 20 lb-ft torque difference in power output between the two. Hardly worth the effort to swap. That power can likely be over come with maintenance and a few bolt-ons.
For any swap, unless it is the same engine (one 2.3L Duratech for another 2.3L Duratech), you're going to have to change other items like wiring harness, PCM, and transmission. Exception for the transmission being if you were swapping a 4.0L OHV for a 4.0L SOHC, but you're not doing that. Assuming like donors (IE: another 2001 Ranger) a 3.0L swap is exactly the same amount of work as a 4.0L SOHC, but the SOHC will give you closer to a 60 HP gain and an extra 80 lb-ft of torque.
IMO if you want a straight bolt in swap, a 4.0L SOHC from another Ranger/Explorer is the only way to go. If you don;t care about being a little less than bolt in, but still fairly easy, find a 2001 Explorer to use for a 5.0L donor. Using another 2001 to maybe 2003 Ranger (01-02? Explorer) as a 4.0L donor would be a bolt in swap and legal in all states. Using a 2001 5.0L Explorer would be a little more work, but again can be made legal in all 50 states.
If you are planning to keep what ever engine you swap in stock, I kind of don't feel like a 5.0L is even worth it over the SOHC. Especially on a 2001, where only a single year of Explorer meets guidelines for a legal swap (same year or newer engine). The V8 has about 40 extra ft-lb of torque, but only 3 extra HP.
PATS thing that Brian mentioned will be an issue. In 2001 it was not as integrated as he warned about, I don't think that came until 2004. IIRC the 4 cylinders in those years did not have PATS. All of the 98+ V6s had it, as well as the 98+ V8 Explorers, again IIRC. You'll have to swap in PATS along with the engine, or get it programmed out of the ECU. You'll need a bunch of wiring and parts from the donor vehicle, so it makes most sense to get the entire donor to pull what you need.