I'd suggest that you assign Bullet an instance variable of "Parent" or something. Then, in the Bullet creation event, the correct Enemy is already picked since it's the one spawning the Bullet, so simply assign the value of Bullet.Parent to enemy.UID.
Later, when the Player is hit and killed and you want to increase Enemy.XP, pick the Enemy by its unique ID and add to its XP.
EDIT: Hah, ninja'd by zatyka!