Inspired by the current OOTS story thread, I was trying to think my way around a resolution for the situation and wondered:
Would it be valid for an undead cleric to cast resurrect on himself?
YES!! It took longer than it should have but I found it.
Yes, an Undead Cleric could resurrect himself, although, not directly as would normally happen. This is assuming that, aside from his Undead state, he would otherwise be eligible for resurrection. (Mainly that he has been dead (including Undead) for less than 10 years.
First the caveats:
The first hurdle, which was brought up in the other answer is that your Cleric must still have it's Cleric abilities. To my knowledge, Pelor is not in the habit of granting spells to Undead. And deities who love Undead would be not be inclined to grant a spell to make him un-Undead. Wee-Jas may have no problem with this, and in fact with material in the Complete Divine would probably gladly endorse such things. Also, Clerics who have no Deity but instead worship an "ideal" should retain their abilities (even if their ideals change upon being Undead). (Resurrection is not a good spell so evil Clerics can cast it)
The MAIN hurdle, as was pointed out earlier, is Undead creatures can NOT be resurrected. However, "You can resurrect someone...who has been turned into an undead creature and then destroyed."
So how do we overcome? Well we have to be prepared to destroy ourselves!
From "Complete Arcane" we have a feat called "CRAFT CONTINGENT SPELL" available to casters of atleast 11th Level. Direct quote from the text: "Triggers for contingent spells are usually events that happen to the bearer of the spell, and can include death."
This is an Item Creation Feat so there are significant additional costs to use this but it gets the Cleric his life back which is apparently what this Cleric wants so I'm sure it's a completely acceptable cost.
NOW we have an interesting dilemma. How long, in levels, has your Cleric been Undead? Was he level 5 when he was "turned" and now he's level 13...is your Cleric prepared to go to level 4 when resurrected? I'm not sure that he has to, but it appears so. I think I read another question on the matter but I can't find it right now. If I do I'll link it in later, if not it would make for an interesting related question.
Target: Dead creature touched
You can resurrect someone [...] who has been turned into an undead creature and then destroyed. [...U]ndead creatures can’t be resurrected.
The vampire/zombie/etc must first be destroyed, and then resurrected, as an undead creature is not a dead creature and thus is not a valid target regardless of who casts the spell.
I suppose a properly-worded contingency spell keyed on the cleric's death might work, but I seem to recall that D&D spells often suffer from a lack of ontological inertia. So that would have to be looked into.
A Good cleric, getting his spells from a Good god, would upon becoming an Evil undead creature be violating one of the basic cleric class requirements.
A cleric’s alignment must be within one step of his deity’s.
And is probably considered to have violated his god's code of conduct, too.
A cleric who grossly violates the code of conduct required by his god loses all spells and class features, except for armor and shield proficiencies and proficiency with simple weapons.
So this is all academic for the poor guy, though we can of course envision a Whatever Neutral priest of Wee Jas or Olidammara retaining her spellcasting abilities in a similar scenario.
[Please note that casting resurrection is not itself an act with Good or Bad connotations in the D&D alignment mechanics: it has no Good or Evil spell descriptor. It would be a foolish god indeed who banned the resurrection of his champions, so the spell is available to any caster with the appropriate class levels and spell list.]
Assuming you are of high enough level there's a pretty simple way to do it:
It's going to take some epic feats to have a high enough level spell slot but it can be done. Cast it, destroy yourself and you come back living.
Lower level but more expensive would be to craft a metamagic item of greater delay spell.
Personally, I'd allow it anyway on a willing target.
Yes, he can.
Here is a quote from the undead type found in the SRD:
Not affected by raise dead and reincarnate spells or abilities. Resurrection and true resurrection can affect undead creatures. These spells turn undead creatures back into the living creatures they were before becoming undead.
Of course, the problem with this is that a cleric who does this, will, by RAW, not retain any experience he gained while being undead. In fact, he might not even remember being undead, because he turns into the living creature he was before becoming undead.
Resurrection or True Resurrection and a bottle of experience (Complete Arcane) would allow a cleric to resurrect him or herself while retaining all levels gained while undead.