Later on, the scene changes to 
Ash and his friends, who are battling a Barbaracle. Later, in Avignon Town Ash battles an Ace Trainer named Astrid. Pikachu battles Astrid's Pyroar, and defeats it with Electro Ball. They then switch over to Froakie and Meowstic, respectively, who engage in a very close battle, but ultimately, Meowstic overpowers Froakie and defeats it. Meanwhile, Diancie is on its way to the town, when she is attacked by a mysterious woman with a Delphox and a man with a Greninja, who give chase to it around the city. The scene then shifts over to Ash and Astrid once again, where Ash sends out his Hawlucha, and Astrid sends out Absol, which she proceeds to Mega Evolve, much to the amazement of Ash and friends. Hawlucha battles well, but is defeated by Dark Pulse. Ash then comments on how powerful Mega Evolution is.As the movie begins, Diancie is happily running from her Carbink servants in the Diamond Domain, while one of them, Merrick, tells her that it is time and that he is not playing. However, he then trips on a pile of diamonds that fall on him and the other two servants, Bort and Allotrope. An elderly voice then calls for Diancie, revealing itself to be Dace, the elder Carbink. He tells Diancie that the Heart Diamond, which powers the Diamond Domain, will soon die, and the domain will falter as a result. However, Diancie accuses him of exaggerating and that worrying too much will cause him to lose his luster. Dace, however, tells her to take it seriously. After Diancie tries and fails to make a Heart Diamond in front of Dace and the Carbink servants, she begins to feel hopeless, but then Dace tells her to find Xerneas and its Fairy Aura. He reveals that when he was young, a catastrophe occurred in the Allearth Forest, destroying the forest and killing him, but he was revived by Xerneas, which is why he is still alive. Meanwhile, in a battle arena, Diantha and Wikstrom are battling with Mega Gardevoir and Mega Scizor, respectively, as Diantha wins the match.
As Ash and his friends are walking around town, Pikachu hears something in the distance and goes to investigate, with Ash and co. following. They then see a Pokémon get attacked by a mysterious woman and man, Merilyn and Riot respectively, as the two begin to argue over possession of Diancie. Ash quickly steps in to help Diancie, and tells Marilyn and Riot to stop, also telling Diancie that this is her chance to escape, while SerenaClemont, and Bonnie lead her to safety. Riot also calls Marilyn a blabbermouth for her talking. Ash has Pikachu use Thunderbolt on Delphox and Greninja, which knocks them out and Ash then flees.
Once everything has been cleared, Diancie tells Ash and friends that she is very grateful to them for saving her, surprising them as she can talk. Clemont notes that this is via telepathy, and Bonnie remarks on how cute Diancie is. Serena gets out her guidebook, and reveals that this Pokémon is called Diancie, and that she has the power to make diamonds. Ash and friends also introduce themselves to Diancie. They also inform Diancie of what a thief is, and Diancie then remarks on how much she has learned already of the outside world. Meanwhile, Team Rocket is spying on them from a rooftop.
Ash and friends go to have dinner along with Diancie, and Diancie then eats with them. Diancie tries out some of the new food, and when Bonnie asks Diancie to join her to get more food, she formally accepts the offer. Serena remarks on how Diancie has manners like a royal princess. Team Rocket then sneaks up on the crew with a sack, and they take Diancie and kidnap her, to which Ash and friends then try to follow. Team Rocket then carries Diancie to a clock tower, then demanding her to make diamonds for them. She does so, making a large amount of diamonds that they bathe in. Meanwhile, a mysterious girl then arrives and helps Diancie run from the clock tower. She then reunites with Ash and friends. She also tells them that her objective is to find Xerneas and its Fairy Aura in hopes that she can be able to make permanent diamonds. Clemont remarks on how Xerneas is the Legendary Pokémon of life. Diancie also explains that her diamonds are only temporary, and that Team Rocket will be majorly disappointed. Meanwhile, back at the clock tower, the diamonds all disappear, much to their own dismay. Ash and his friends then want to join Diancie in her quest to find Xerneas, and Diancie approves in a very formal tone, to which Ash is surprised. Bonnie and Serena remark on how Diancie again shows manners of a royal princess.
Meanwhile, the mysterious girl, named Millis Steel, returns to a stealthy ship, which inside, a man named Argus Steel is monitoring the activity of Diancie as well as that of Marilyn and Riot. Argus then notices Team Rocket, but then exclaims that they're only the least of his worries. He is also eating a box of chocolates in the process. Millis then arrives and remarks on Diancie's progress. Argus is satisfied, and he then goes on to talk about chocolates and how a certain chocolate is good and has great quality. Millis then begins to worry about Argus's health as well as his obsession with chocolate, to which Argus states he is aware. Despite this, he cannot resist the chocolate he is holding and eats that as well.
The scene then changes to Ash and his friends, along with Diancie, sitting in the back row of a bus. Diancie then feels the Fairy Aura, and explains to Ash and friends that the Fairy Aura is sensed in a trail after they ask if she is sure they are going down the right path. She also tells Ash and friends that she was taught to be honest, and that lying is never a good thing. Meanwhile, Ash rubs Pikachu on the head, much to the latter's enjoyment.
As night falls, Ash and friends are preparing to go to sleep. Diancie then tries to make another Heart Diamond, but fails. She then notices a shooting star. As such, Ash, who was awakened by this, then decides to teach Diancie how to make a wish upon a shooting star, and the two proceed to make a wish. Ash then wishes upon the shooting star that Diancie will one day be able to make the best diamonds she had ever made. Serena is staring from her tent in admiration.
The next morning, Ash and his friends then take a ship to Orsay City, along with Diancie. She remarks on how she has had the most fun ever since she joined Ash and friends. They then tell Diancie that they are her friends, and explain to her what friends are. Diancie then suddenly creates a diamond, which Bonnie catches. Diancie tells her it will disappear eventually, but Bonnie asks her to let her keep it, so Diancie then approves. They enjoy the view of the sea, but all of them get water splashed on them. They then head to the city, and decide to go to the shopping mall. Diancie, with her lack of knowledge of the real world, assumes that it is a castle, and asks Ash and his friends who the "castle" belongs to, but Ash and Serena tell her that it is not a castle, but rather a shopping mall. Bonnie and Serena then decide to take Diancie shopping, and run to a clothing store, trying on new clothes for fun while Ash and Clemont wait in the hall in boredom. As Diancie is trying on a new dress, with Serena and Bonnie seeing her as a real princess, Diancie begins to panic when she realizes that Merrick, Bort, and Allotrope are in the shopping mall.
Bonnie and Serena then reunite with Ash and Clemont, and they tell them to hurry up with the shopping. However, Diancie then begins running in a panic when she sees Merrick, Bort, and Allotrope walking down the other staircase, and runs around telling Ash and friends that they found her. Diancie then runs around the entire shopping mall while the three Carbink give chase. Ash and his friends begin to think that the Carbink are working with the thieves, and Clemont uses his stretchable ladder to help Ash get Diancie, which Ash uses along with Hawlucha to get Diancie back, and he grabs her and they begin to look at each other in happiness. Merrick is dismayed.
Ash and his friends then are outside, wondering what Pokémon Merrick, Bort, and Allotrope were. Clemont reveals that they were Carbink, and that it was such a rarity for them to show up in the mall. Diancie then sadly states "They finally found me...". Just then, Marilyn appears in front of them, asking Diancie about her first shopping experience then proceeding to try and steal her once again. Ash battles Marilyn, while Serena acquires a Rhyhorn from a ranch, and brings herself, Diancie, Clemont and Bonnie aboard to safety, almost disturbing an ongoing Rhyhorn Race. Diancie is then dismayed, saying that she had led them into danger and that this is all her fault, but Clemont tells her that friends always support each other. Bonnie is angry at Clemont for having stolen what was supposed to be her line. Riot, however, then appears along a tree, and he also tries to steal Diancie using his Greninja. Clemont and Serena proceed to battle Riot's Greninja, and Ash soon joins in. Marilyn also begins to try to capture Diancie, and as Delphox and Greninja attack Diancie, however, Merrick, Bort, and Allotrope step in front of Diancie and take the attacks for her. As another set of attacks launch, Diancie uses Diamond Storm to protect her loyal Carbink servants, but this diamond shatters. A Pin Missile hits Greninja, revealing it to be the girl that helped Diancie get away from Team Rocket, along with her Chesnaught. She then tells Diancie to get away while she still can, and she then fights Marilyn and Riot. Marilyn recognizes her as Millis Steel, remarking that her presence must mean that Argus Steel is present as well.
Later on, Ash and his friends are walking with Diancie and the Carbink. Merrick then tells Ash and his friends that his job, along with that of Bort and Allotrope, is to protect Diancie at all costs. Bonnie and Serena then remark that she is a real princess, and that the Carbink must be her bodyguards. Merrick then asks Diancie who Ash and company are, and before Ash can explain, Diancie tells Merrick, Bort, and Allotrope that Ash and company are her friends. This leaves the Carbink servants mildly surprised. Merrick also tells Ash that they have been searching for Xerneas for many months, and have not succeeded. Diancie then reveals that she saw a city in the distance one day, and it looked very fun to her, and she went while the Carbink were asleep. Merrick then reveals that he was worried that Diancie must have felt trapped by his, along with Bort and Allotrope's presence. Diancie then apologizes for running away, and Merrick tells her to never do it again.
Diancie and the Carbink then bring Ash and friends to their home, the Diamond Domain. However, Diancie and the Carbink come home to see the Diamond Domain in darkness and beginning to fall apart. Diancie then wonders what has happened. Dace then steps in, and sadly reveals to Diancie that the Heart Diamond has died, much to Diancie's surprise. Ash and friends then ask Diancie what the Heart Diamond is, and she explains that the Heart Diamond powers the Domain, and that it will now no longer do so. Dace then explains that only Diancie can create a new Heart Diamond. Diancie tells Dace that she still lacks the power to make a new Heart Diamond, but Dace then tells Diancie that he has every confidence that Xerneas will awaken her true power. Ash and friends then realize why Diancie is seeking Xerneas. Diancie then begins to break down and cry, saying that she has failed her own people and that she doesn't deserve to be called a princess. Ash, however, tells Diancie that crying won't solve anything. Diancie then agrees to that and begins to feel more determined. Dace is moved by this.
Ash, his friends, Diancie, and the Carbink (this time including Dace), then leave through another exit, and they see a large, lush forest, much to their amazement. Dace then reveals to Diancie that this is the Allearth Forest, and that it is a forbidden forest due to the presence of what is known as the "Cocoon of Destruction", a Pokémon called Yveltal, and that whoever disturbs its sleep will receive harsh retribution. Ash and his friends, along with Diancie and the Carbink, then walk through the forest and see all the Pokémon peacefully living. However, Diancie then senses an aura, and she then runs quickly, but trips over a log. When she gets up, however, standing right in front of her is Xerneas. She then speaks to it, with Ash, his friends, and the Carbink watching. Xerneas then speaks through its Fairy Aura, revealing that it knows that Diancie has been following it for a while, and it knows what it seeks from it. It then gives Diancie its Fairy Aura, which the Carbink servants and Dedenne as well. Before it leaves, it tells Diancie that the power to nourish life lies within Diancie herself. Diancie then states that she is very grateful.
However, before Diancie can begin testing her powers, Millis Steel and Argus Steel arrive by ship, having revealed that they only helped Diancie as they knew she was seeking Xerneas and that they now want her powers at that moment. Team Rocket watches from the distance, recognizing the Steels as master thieves. Marilyn and Riot also appear, along with Team Rocket, and they all begin to fight over possession of Diancie. This fighting eventually takes them into a lake with a deep crater, and all of the thieves fall in, along with Ash, and they all feel a mysterious power inside the lake. Soon, this power begins to awaken, just as Diancie and the Carbink, along with Ash's friends, arrive on the scene. Dace is then dismayed and tells Ash and Diancie that they must get out of there quickly. A mysterious cocoon then appears out of the center of the lake, to which Dace reveals is the Cocoon of Destruction.
As the Cocoon of Destruction appears, it awakens and reveals itself to be Yveltal. It then activates its Dark Aura, and looks at all who disturbed its sleep, as Marilyn, Riot, and the Steels escape the crater. Yveltal then roars loudly and flies around the forest. It goes after Riot first, flying and firing Oblivion Wing on all of the forest around Riot, turning all of the trees around him into stone. This also hits Greninja and his two Ninjask, turning them into Stone, as Diancie escapes from Riot's possession, only to be taken by Marilyn. Yveltal then goes after Marilyn and her Delphox and Yanmega, and turns the forest around her into stone with Oblivion Wing, along with Delphox and Yanmega. She then looks on in sadness as Diancie escapes. She almost reunites with Ash, his friends, and the Carbink, but the Steels, on their Aegislash and Doublade, then proceed to take Diancie. Yveltal then uses Oblivion Wing on the Steels again, which Chesnaught desperately tries to block with Spiky Shield. However, even though Diancie, the Steels and Aegislash survive, Honedge, Doublade and Chesnaught are turned to stone. As Yveltal launches another attack , Ash Pikachu use Thunderbolt to block the attack, saving the Steels. Diancie then escapes with Ash. Meanwhile, Team Rocket is trying to escape, but Yveltal finds them and fires Oblivion Wing, turning them and the trees around them to stone as well. Elsewhere, Marilyn is grieving over the loss of her Delphox, but Riot steps in and comforts her, telling her to forget about Diancie The two embrace before Yveltal then fires another Oblivion Wing at the two.
Diancie and Ash then try to fight off Yveltal, and escape. Ash's friends and the Carbink then see the situation, and Dace realizes the forest is dying once again. Diancie then tries to protect Ash and friends from another Oblivion Wing with Diamond Storm, but the diamond shatters again. Ash and Diancie run off, but Yveltal fires another Oblivion Wing. However, Merrick, Bort, and Allotrope then step in to take the Oblivion Wing, and they too are turned to stone. As Merrick is being turned to stone, he tells Ash to protect Diancie. Ash and Pikachu are then sent flying, and Ash tries to save Pikachu on a cliff, and Clemont, Serena, and Bonnie are then trying to help Ash up. Meanwhile, Diancie begins to cry and think of herself as a complete failure upon failing to create a Heart Diamond, as well as seeing Merrick, Bort, and Allotrope having perished. Soon, with determination, however, she then proceeds to Mega Evolve. The diamond she gave Bonnie glows, revealing it to be a Diancite. Diancie then creates a new diamond to protect Ash, his friends, and Dace from another hit, and this diamond does not shatter. Dace remarks on how Diancie is now finally able to create a heart diamond.
The Steels then arrive in their ship, and proceed to fire missiles at Yveltal to hurt it, but Yveltal dodges many of the missiles and survives the damage. It then flies above the ship and shatters the top, then firing an Oblivion Wing at the Steels from point-black range, and the ship's engines explode. The ship crashes into a lake. Yveltal the proceeds to fire a final Oblivion Wing as Ash and company, but this one is then intercepted by an Aurora Beam. Ash and his friends then look towards where the attack was fired, and this is revealed to be Xerneas standing and confronting Yveltal. Yveltal then fires a Shadow Ball at Xerneas, but it uses Aurora Beam again to intercept the hit. It then uses its Fairy Aura to communicate with Yveltal and remove its Dark Aura. Yveltal then restores the water and flies off in peace.
Ash and his friends are then relieved that Yveltal had left. However, Pikachu then begins to lose its strength. Ash tries to ask Pikachu what is wrong, but then Pikachu suddenly begins to steadily turn into stone, much to everyone's dismay, and Clemont realizes Pikachu was barely struck at the edge of its tail by Oblivion Wing. They all grieve over Pikachu, but then Xerneas steps in and uses Geomancy, restoring Pikachu, the thieves, Team Rocket, and the Carbink to life, as well as restoring the entire Allearth Forest back to its original state. As it does so, however, it begins to transform into a tree. Dace then tells everyone that Xerneas has chosen to slumber here to protect the balance of nature. Serena, Bonnie, and Diancie worry that this may mean the death of Xerneas, however, Xerneas then communicates through Diancie via its Fairy Aura, telling her that it is not dying-but rather that this is the promise of life, and the beginning of hope.
Ash and his friends then watch as Diancie creates a new Heart Diamond, and everything has ended well. Bonnie gives Diancie the diamond, telling her that this will forever be the mark of their friendship. They then part ways with Diancie and the Carbink.
In the credits, Serena is making a wish, with Ash watching. It is revealed that Argus and Millis now run a chocolate shop, with one of their signature chocolates resembling the Honedge line. Merilyn then acquires work at a clothing store, while Riot comes to her, and proposes marriage. Ash and his friends then continue their journey through Kalos. Meanwhile, Yveltal flies peacefully over a mountain, and Xerneas remains in the Allearth Forest in its tree form.