Instructions
Fight Grand Master Greevil. He will use "XD001" to finish you; XD001 is Shadow Lugia.
Catch Lugia using the Master Ball. If you haven't saved the Master Ball, you'll have to catch it the old-fashioned way; weaken it as much as you can, use whatever pokeballs you have on you and hope.
Take Lugia to the Purification Chamber. Lugia can only be purified with the Purification Chamber.
Bring all nine chambers of the Purification Chamber to maximum tempo. Some examples of sets that will do this are Wooper facing Houndoom facing Ledyba facing Hoppip; Surskit facing Sandshrew facing Ampharos facing Hoppip; or Seedot facing Sandshrew facing Elekid facing Lapras. You should play around with other configurations to see what works.
Place Lugia in any of the Purification Chambers, and he will be purified.