Resonance-mediated atomic ionization dynamics induced by ultraintense x-ray pulses