In photoelectric effect, the photon falling on some matter is absorbed by the matter and its energy is transferred to an electron of the matter. In X-ray production, photons are produced which get energy from energetic electrons ionising the inner shells of the target which in turn cause a cascade of emission lines.