Here's an updated capx
What I did was, instead of adding to the width of the XP bar directly, I stored the 20xp gained from killing enemies in a new variable called XPToAdd. Then I created a new event that, every tick and as long as XPToAdd was greater than zero, would add 1 to the width of the XP bar and subtract 1 from XPToAdd. The result is an animated XP bar.
PS: You should look at storing your XP in its own variable, instead of relying on the XP bar to track the total XP (this also allows you to scale up the XP required to gain a new level). The bar should be a representation of the XP, rather. You can set its width as a percentage of its total, like [(current XP / required XP for next level) * 200].