Hundreds of years prior to the movie's events, Yveltal almost destroyed all life in Allearth Forest. Xerneas saved Dace and many other Pokémon from the destruction, and later reversed all the damage Yveltal did.
Diancie, unable to create diamonds without them disappearing after a few seconds, sought after Xerneas in hopes that it would give her the power to create diamonds that would not disappear, as if the Diamond Domain's Heart Diamond disappeared, the Domain could collapse, and Diancie was not able to create a new one. When Diancie met Xerneas, it revealed it was aware of Diancie's reason for seeking it, and told her that the power was within her. It then granted Diancie what she was looking for: its Fairy Aura. Soon after, it gained a telepathic connection with Diancie.
Later, after Yveltal awakened again and had petrified large areas of the forest, Team Rocket, Marilyn Flame, Ninja Riot, TheSteels, the Carbink servants (save for Dace), and Pikachu (who tried to battle Yveltal) with Oblivion Wing, Xerneas eventually protected Ash and his friends from Yveltal's Oblivion Wing by using Aurora Beam to counter it. It then used Fairy Aura to calm Yveltal's rage, after that, Xerneas used Geomancy to revive everyone and everything Yveltal had petrified. While using Geomancy, Xerneas began changing into its tree form. When asked if this meant that it was dying, it responded that it was simply beginning a new life.
Personality and characteristics
Xerneas is shown to be a very helpful Pokémon. Prior to the events of the movie, it saved the Allearth Forest from Yveltal and reversed much of the damage it did. It also revived Dace after it perished in the event. It granted Diancie its Fairy Aura, knowing that she sought after it for that reason. Later, it saved Ash and his friends by quelling Yveltal's rage, then restoring the life of the Allearth Forest using Geomancy.