Attacked while Questing
If you are in a contested or enemy region (zone), there exists a danger of being attacked while you're trying to complete your quest(s). You should be aware of this risk. If you're trying to level up, you might wish to pick areas where the enemy is unlikely to attack, thus reducing the risk of confrontation. Alternatively, be aware that you can level up in instance areas where the enemy cannot attack you.
Body Camping
If the enemy begins camping (waiting in the area of your corpse for a long time) your body, you have several options:
The area for reviving is very large so you can pick a spot furthest away from the enemy. Revive and run further away from the enemy.
Wait. You can wait until they leave. You can simply alt-tab and let them waste their time while you're away from the computer.
Have someone else lead them away from your body.
Revive, run away, and then use a Hearthstone to get away