4.0 would obviously be easier. It's an engine that's actually in a Ranger. Not sure about the mounts, but I'm sure if you do some searching you can find plenty of information.
The 4.6 swap is tough. The modular engines are much wider then the engines we have in our trucks. It's been done... but it's way more work. A 5.0 swap from what I've seen is an easier V8 swap, however, for any swap, I would highly recommend just searching around the forum (and RPS for more information).
All and all any swap you can think of should be covered already.
1999 Ranger XLT -- "Project Unknown"
2010 Subaru Impreza -- "The Daily"