Neither by an electric field nor a magnetic fieldSince X-rays do not have any charged particles, they are not deflected by an electric field or a magnetic field.