Atomistic investigation of cavitation and ablation in tantalum foils under irradiation with x-rays approaching 5 keV