Really depends on how much time and money you have to spare. Putting in another 4.0 is obviously the easiest and cheapest option. With a 5.0, you'll have to think about what transmission you want to use (automatic is easier), new exhaust, radiator, will you do a body lift to help with clearances, etc. You'll need to get new motor mounts. And a lot of things, and the expenses add up. I think most people end up spending well over $1000 on a 5.0 swap, some up to $3000, I think. Check out the V8 conversion forum for more info. I think there are some stickies that explain the basics. Actually the tech library has some good basic info on it also.
I just replaced my 4.0 (I have a 1994). Our trucks are OBDI, where as the 97 explorer is OBDII (anything 95 and newer I think). So for that you'd need the wiring harness and computer. I used a 4.0 out of a 92 and used my old harness and computer. Easy. And it had to be, since it's my daily driver. You can do it, but the easiest for you would be something from a 94 or earlier. But yeah, if I had the time and money and a little more knowledge I would go for the V8 swap in a heartbeat.