Li Shenron
Legend
I think the DM should weight the Xp considering which is the intent of the enemies and which is the goal of the party, although they may not be aware of their own real goal
.
Clearly, if the enemies are making a hit-and-run attack, and the party doesn't kill a single enemy, they shouldn't be awarded any Xp. In this case the party's goal could be to capture or kill the attackers (even if the characters may believe that making the enemies fail the attack was their goal, instead the DM knows that the attackers meant to run away).
If the attackers' intent is to kill or capture or pillage or whatever, and they are forced by the party to retreat without accomplishing their mission, then the party has achieved a goal even if no enemy was actually killed.
It rather matters on who really "won" by achieving their goal in the attempt.

Clearly, if the enemies are making a hit-and-run attack, and the party doesn't kill a single enemy, they shouldn't be awarded any Xp. In this case the party's goal could be to capture or kill the attackers (even if the characters may believe that making the enemies fail the attack was their goal, instead the DM knows that the attackers meant to run away).
If the attackers' intent is to kill or capture or pillage or whatever, and they are forced by the party to retreat without accomplishing their mission, then the party has achieved a goal even if no enemy was actually killed.
It rather matters on who really "won" by achieving their goal in the attempt.