They get full XP for the combat (or encounter/situation) they died in.
Then they get the level hit.
However, we have house ruled level loss to be a flat XP loss of 1,000 XP times previous level minus one (i.e. -10,000 XP if going down from 11th to 10th level). Makes things a lot easier. And yes, it's possible to not actually lose a level, if you are very close to leveling up.
Bye
Thanee