At this stage I think your DIY testing has been rather successful and you can now replace those two items fairly confident they are not the cause of your booming fuel tank, but your on the right track!
The root cause is most likely a problem with the Fuel Vapour Vent Valve, fitted in the top of the fuel pump module that is in the top of the fuel tank, as shown here in the w'shop manual. It's a press-in fit.
Air pressure in the tank should relieve through this valve, pass through the charcoal canister where the fuel vapour is absorbed and on to atmosphere. Every so often, when a variety of conditions are met, the purge valve will open and fresh air is drawn in and through the canister to flush it clear of trapped fuel vapour and on to the engine induction arrangement to be burnt.
If the vapour valve sticks shut, or the pipework has a blockage, pressure variations in the tank can cause the sort of noises you're experiencing and also can be observed by opening the tank filler cap and hearing an in or out rush of air.
Note that the Emissions Control System varies between 4.0 and 4.2 models and also the USA models have a more complex system to meet the more stringent requirements of that country
For 4.2 models, access to the Vapour Valve is dependent on your exact model version; coupes have an access route via the sub-bass speaker in the parcel shelf whereas convertibles require the fuel tank to be removed, but both methods are awkward, so an alternative work-around is used by some and that is to add a vent hole to the filler cap. This was addressed in short articles in the Modern XK part of the magazines in March and April editions of 2023 by our then co-ordinator Jim Mann and can still be found in the Membership Section of this Website.
As my boot lining is removed at the moment I've managed to get this photo showing the arrangement on top of the fuel tank.
The black Vapour Valve is clearly accessible venting to the steel pipe running along the rear edge of the tank to the left ,and with a bit of effort with a suitable lever, the valve does start to lift out - I've gone no further
