So a Wraith is Undead, its melee attacks deal negative energy damage. It doesn't specify that it only works on living foes (Lich for example can deal negative damage only to living creatures).
So, theoretically, the Wraith can hit himself and heal that way, since it doesn't state that he can't do it. And his ability doesn't say that it doesn't work on undead foes.
Am I missing something or does it work like that?