You breed Pokemon for IVs. EVs are obtained through battling other trainers. If you want better/different IVs on your xerneas, the only way is to soft reset for a better IV spread.
But since this question is about EVs and not IVs, here's the easiest method to EV train your Pokemon (yes, this works for all 721 Pokemon):
Step 1.) Obtain a Pokemon that can learn the move sweet scent. This is helpful for finding horde battles, where you get 5x the EVs per battle.
Step 2.) Obtain the macho brace. It can be found on Route 15 or you can recieve it through the pokemileage club.
(Optional) Step 3.) Obtain a Pokemon with pokerus. Put this Pokemon in with the Pokemon you want to EV train, and the pokerus will eventually spread to it. Note that pokerus has a certain time restraint and you cannot be infected by it on the same Pokemon twice.
Step 4.) Battle. Find the stat you want to increase and go to the route listed next to it below (note you can only get 510 EVs total and 252 EVs per stat). Then just go to Pokemon, use sweet scent, and rake in the EVs.
HP: Gulpin Route 5 or Whismur Connecting Cave
Attack: Weepinbell Route 19 (if it is raining, head to frost cavern and fight cubchoos)
Defense: Nosepass Route 10
Special Attack: Smoochum/Vanillite Frost Cavern
Special Defense: Hoppip Route 7
Speed: Wingull Route 8
If you find a horde for an EV stat that isn't what you want, do NOT fight it! Run from it and repeat the sweet scent process.