One thing I forgot to say:
D&D is a game of general rules and many exceptions, and as the DM it's your job to figure out what those exceptions are using common sense.
The general rule should be "a character has to be incapacitated going into the encounter (battle or trap) to not get XP."
The exceptions would be, "well, the Cleric decided to stand outside the dungeon to watch the horses instead of facing the challenges inside -- no XP for him." OR "the Fighter decided to run outside the dungeon while the Rogue, too far away to call for help, disarms the trap -- no trap XP for him." and so on and so on.
Even then, there's exceptions to exceptions. A player who voluntarily decides to run away from an encounter in round 1 shouldn't get XP, but if in the surprise round the evil Wizard NPC puts the Rogue under a complsion that forces him to run away, that's something entirely different.
There's no sense trying to go through and list all the possible exceptions. At best we can throw out some examples. A guiding principle would be, "is a player going out of his way to avoid the encounter?"
With traps, the Rogue is about the only one with any useful way of dealing with them, so he probably is going to be the only one actively engaging in its disarming. It's wise for the players who can't add anything to actively disarming it to stand back. But, as people have illustrated, there's a difference between retreating to a safe corner of the room and retreating to outside the dungeon.
Hope that sheds a better light on the discussion.