How should XP be awarded when facing enemies with class levels? [duplicate]


A lot of games I’ve been in have had either enemies with player levels or straight up PvP. How should XP be awarded when facing enemies like that? Should you attempt to calculate the CR of the enemies based on the DMG tables or is there a guideline on how XP should be awarded based on the class levels?