~Ruby/Sapphire to XD:
In Ruby/Sapphire defeat the elite four and let your data get recorded in the hall of fame, in XD defeat Greevil in the second battle, you can now trade between the version
(in order to trade in XD you need to go to the pokemon center in Phenac City)
~Emerald to XD:
See Ruby/Sapphire to XD.