Purification is the process of returning a Shadow Pokémon to it's former self. It was major aspect of Pokémon XD, Gale of Darkness.
The Doors
Shadow Pokémon's hearts are locked behind several 'Doors' in which the player must open to get to the Pok'emons heart. To open up a Door the player must continue to battle with the Shadow Pok'emon he/she would like to purify. After every battle a small piece of the door you are working to open will turn white, indicating that you, and your Pok'emon have became closer. You must open each door before you can actually purify the pok'emon.
How to Purify
Once you have opened up every Door to the pok'emon's heart you will need to travel to Agate village and activate the Stone deep inside the Agate forest. Once you activate it choose which Pok'emon is ready to open up it's heart and enjoy the scene afterwards. You're newly 'Pure' Pok'emon will then gain Experience points that it missed for being a Shadow Pok'emon (And will likely level up) and the Pok'emon will forget the Shadow Rush move. In XD you can also purify by using the computer system in the Pok'emon HQ
Flute
Once you obtain the Flute you can purify one Pok'emon from wherever you are. Once you use the Flute it will break.