Curse and marriage to Budha
In the Ramayana, Linga Purana, and Mahabharata, Ila grows to become the king of Bahlika. While hunting in a forest, Ila accidentally tresspassed Saravana ("Forest of Reeds"), the sacred grove of goddess Parvati, the wife of Shiva. Upon entering Saravana, all male beings except for Shiva, including the trees and animals, are transformed into females. In the Ramayana, even Shiva had assumed the form of a female to please the goddess.One legend tells that a female yakshini disguised herself as a deer and purposefully led king Ila to the grove in order to save her husband from the king. The Linga Purana and Mahabharata emphasize the sex change of Ila to be a deliberate act of Shiva to start the Lunar Dynasty. The Bhagavata Purana et al. texts tell that Ila's entire entourage as well as his horse also changed their genders.
According to the Ramayana, when Ila approached Shiva for help, Shiva laughed with scorn but the compassionate goddess Parvati reduced the curse and allowed Ila to switch genders every month. However, as a male he would not remember his life as a female, and as a female she would not remember her life as a male. While Ila roamed the forest in her new form with her female attendants, Budha, the god of planet Mercury and the son of the moon-god Chandra noticed her. Although he had been practicing asceticism, Ila's beauty caused him to fall in love with her at first sight. Budha turned Ila's attendants into Kimpurushas (hermaphrodite, lit. "is it a man?")and ordered them to run away, promising that they would find mates as Ila had.
Ila married Budha and spent an entire month making love to him. However, Ila woke one morning as Ila and remembered nothing about the past month. Budha told Ila that his retinue had been killed in a rain of stones and convinced Ila to stay with him for a year. During each month she spent as a woman, Ila had pleasure with Budha. During each month as a man, Ila turned to pious ways and performed austerities under the guidance of Budha. In the ninth month, Ila gave birth to Pururavas, who grew to become the first king of the Lunar Dynasty. Then, as per the advice of Budha and Ila's father Kardama, Ila pleased Shiva with a horse-sacrifice, and Shiva restored Ila's masculinity permanently.
Another legend from Vishnu Purana credits the god Vishnu of restoring Ila's manhood as Sudyumma. The Bhagavata Purana et al. texts tell that after Pururavas's birth, the nine brothers of Ila or sage Vasistha ' the family priest of Ila ' pleased Shiva to compel him to give the boon of alternate month manhood to Ila, turning him into aKimpurusha. Linga Purana and Mahabharata record the birth of Pururavas, but do not narrate the end of Ila's alternating gender condition. In fact, Mahabharata describes Ila to be the mother as well as the father of Pururavas. According to another account found in the Vayu Purana and the Brahmanda Purana, Ila was born female, married Budha, then was transformed into a male called Sudyumna. Sudyumna was then cursed by Parvati and transformed once again into a female, but became a man once again through Shiva's boon.
In almost all versions of the tale, Ila wants to live as a man, but in the Skanda Purana version of tale, Ila desires to be a woman. The king Ela (Ila) entered Parvati's grove at Sahya mountain and became the woman Ila. Ila wished to remain a woman and serve goddess Parvati (Gauri) . However, the goddesses dissuaded him and told him that life as a woman was a curse and full of sorrow. Ila bathed in a sacred pool and returned as Ela, bearded and deep-voiced.
Later life and descendents
The Devi-Bhagavata Purana tells that as a man Sudyumma governed the kingdom and as a woman remained indoors. His subjects were disturbed by his sex changes and did not respect him as they once had. When Pururavas attained adulthood, Sudyumma left his kingdom to Pururavas and went to the forest for penance. Sage Narada told Sudyumma a nine-syllable mantra, Navakshara, which would please the Supreme Goddess. Pleased with his austeriies, the Goddess emerged before Sudyumma, who was in his female form Ila. Sudyumma praised the Goddess, who merged the king's soul with herself and thus, Ila gained salvation.