the Permanent Committee of Saudi Arabia for Fatwâ and Research
When a woman dies, it is preferable for her to be washed by other women. Likewise, it is preferable for a man to be washed by other men.
However, it is permissible for the husband to wash his wife when she dies and for the woman to wash her husband. The Prophet (peace be upon him) said to his wife `A'ishah : “You do not have to worry if you die before me. I will wash you, shroud you, and bury you.” [Related by Ahmad as an authentic hadîth].
It is worth saying that Imam `Alî b. Abî Tâlib washed his wife Fâtimah when she died and Asmâ’ b. `Umayis washed her husband Abû Bakr al-Siddîq when he died.
A woman may not wash the body of any other male unless he is seven years of age or younger.
Deceased women are only to be washed by women. A man is only allowed to wash his daughter if she is seven years old or less.
In a situation where a woman dies and there are no women to wash her, the attending people should perform tayammum for her (using dust in lieu of water for face and hands only).
And Allah knows best.
Source: Islam Today