I think dropping XP that the player can pickup should just be a matter of creating some XP pickup instances in the function that destroys the pickup. Something like this (untested, pseudo code):
func _on_enemy_death():
var num_xp = rand_range(2, 10)
for i in range(0, num_xp):
var clone = XP_SCENE.instance()
get_parent().add_child(clone)
queue_free()