Glad you got it put out before it got to the interior, and that it wasn't out somewhere on the road or somewhere remote.
Looking at the picture of the outside of the hood, thinking forensically, the burns are stronger on the passenger side of the hood, indicating that the fire may have had more time burning over on that side. You say you had recently replaced the fuel pump. The hard line fitting leading out of it may have been a leak source. Also suspect that the boom you heard might have been an overcharged battery going off, starting the fire. How long before the fire was the car last run? If it was still hot from a trip around town, it could have started anywhere(carb dripping fuel from stuck float-onto a hot exhaust, valvecover oil leak on exhaust, trans ATF leak on exhaust), but if it had some time to cool, but the battery was overcharged, it could have taken some time to short out and result in the boom. I guess what I'm asking is, does the battery look just melted, or does it look like it blew out a side or something? Whatever caused the fire, evidence of it might have been destroyed in the fire's burn time, and it'll probably get replaced in the rebuild. I like your idea of buying a cheap XJ and just doing a complete fuel system swap(possible engine swap, trans swap, rear axle swap?). Yes, burned automotive sheet metal rusts fast, and it also has lost some of its structural integrity(annealed). You might want to get another hood to start fresh with.
I had a fuel pump fail on one of my past Jeeps with the 4.2, and it sent a dribble of fuel down the block along the distributor boss. I stopped to investigate the fuel smell and noticed the fuel-soaked passenger side of the engine, and knew I was in for a hike. In the days before cell phones, I walked a few miles to call home, back when that only cost a dime. I got lucky with that one.