The effect of x-rays on an orbital and charge ordered epitaxial film of a Pr$_{0.5}$Ca$_{0.5}$MnO$_{3}$ is presented. As the film is exposed to x-rays, the antiferromagnetic response increases and concomitantly the conductivity of the film improve. These results are discussed in terms of a persistent x-ray induced doping, leading to a modification of the magnetic structure. This effect allows writing electronic and magnetic domains in the film and represents a novel way of manipulating magnetism.