I’m also working on my roguelike (though I’m not really far into it).
You aren’t really using the XP to calculate damage, you use your character’s level. What you should do is to increase your character’s damage by, let’s say, 20% or so whenever he reaches a certain amount of XP. So once he gains 50 XP, he levels up, increasing his damage and health, then he has to reach 200 XP for the next level, and so on.
Now weapons should be a straight upgrade to the character’s damage output.
Let’s say your character starts barehanded, having the damage output of 3. Then he finds a stick, which should have it’s own damage of something like 7, which overrides your character’s base attack power. So now he has a base damage output of 7, because he wields the stick, and you apply your level bonuses to that.
I hope that helped out, but if I wasn’t clear on something, feel free to ask.