The first pokemon in play seems to get all the xp that battle, even if you switch your own pokemon before the oponent switches his.