Resonant magnetic x-ray scattering study of phase transitions in UPd2Al3.