yeah as the other guy said, you need to prioritize a lot the XP that doesn't damage you (and the 10 dmg enemy that gives a net total of 37 XP)
it may sometimes be risky but most of the time you should be doing good by following that plan, usually you'll have like 2-4 health scrolls most of the time