Hinduism
In contemporary India LGBT people face discrimination and marginalization. This results from cultural attitudes imposed by the British during their long occupation of India. There is no condemnation of homosexuality in the ancient Hindu texts, and no bias against LGBT people is evident up to the 19th century. In a few Hindu lawbooks, same-gender sexuality is described as producing a state of impurity, but it can be expunged by a ritual bath.
The ancient Hindu attitude was that sexuality should be fully integrated into the fabric of life, and nothing to be ashamed of. For instance, in the Brihadaranyaka Upanishad, IV:4, there is a passage about sex magic which was so explicit that Max Müller felt compelled to translate it into Latin.
Homosexuality is discussed frankly and without condemnation in the ancient Hindu sexual treatises. In the Kama Sutra, in Chapter VI, lesbianism in harems is described, and in Chapter IX, male and female homosexuality in the context of a discussion of oral sex. To quote the Kama Sutra, Chapter IX: "...in all things connected with love, everybody should act according to the custom of his country and his own inclination."
There are many accounts of beings who transformed their gender by supernatural means in the ancient Hindu epics and Puranas. One prominent example occurs in the Mahabharata. A transgender person, Sikhandin, plays a pivotal role in that ancient Hindu epic. In book 5, Chapter 191-5, the origin of Sikhandin is related. Sikhandin was born as the daughter of King Drupada of the Panchalas, who had previously been childless. Druapada begged the God Mahadeva, to give him a son. He told him that "Thou shalt have a child who will be a female and male. Desist, O king, it will not be otherwise."
His wife gives birth to a baby girl, Sikhandin. King Drupada conceals the gender of his child and proclaims a male heir has been born, and Sikhandin is raised as a boy. When Sikhandin comes of age, a marriage is arranged with an unnamed daughter of King Hiranyavarman, of the Dasrnakas. Hiranyavarman is described as Drupada's brother. The two women are married, "...and the former soon came to know that that latter was a women like herself." The daughter of King Hiranyavarman sends word back to her father about the deception, and he proclaims war as a result: "Thou hadst, from folly, solicited my daughter for thy daughter!"
At this juncture, Sikhandin flees into the forest, where she encounters a Yaksha, a demon, named Sthunakarna. Sthunakarna says that he will grant one boon to Sikhandin, who asks to become a male, the swap to be temporary until the situation with King Hiranyavarman is cleared up. So the princess exchanges gender with the demon; and, now a prince, returns to the city which the army of King Hiranyavarman is about to besiege. King Drupada tells his brother, now truthfully, that Sikhandin is a man, and that he can prove it. King Hiranyavarman sends "a number of young ladies of great beauty" to Sikhandin, and they report back that he is "a powerful person of the masculine sex." Unfortunately, the demon, now female, is placed under a curse by the lord of the Yakshas, and the sex exchange is permanent. Sikhandin grows into a mighty warrior.
Sikhandin later plays an important role during the cataclysmic battle which is the central part of the Mahabharata. In the climax of Book 8 of the Mahabharata, Bhishma, one of the chief protagonists, is killed because he refuses to attack a charge which is led by Sikhandin, because Sikhandin was born female. This ends up being the turning point in the battle and the war.
In this story we see what might, hypothetically, be an very old tale of a same-sex union woven into the vast epic of the Mahabharata. How old may be indicated by the fact that cousins are being married, which is typical of tribal societies worldwide. In Ancient Egypt women who attained positions of power wore male clothing, including false beards, in order to formally establish their leadership; for such a woman to marry a woman as a political maneuver would not be inconceivable.
Sikhandin, raised as a boy, is ready and willing to exchange gender magically. Once having switched to the male gender, he excels at the role, and becomes a famous and very skilled warrior. Sikhandin is reconciled with his transformed masculine identity, despite the fatal display of chivalry by his opponent Bhishma in battle. This brings into relief the contradictions of ancient Hindu society with regard to gender roles.
The story of Sikhandin is the classic hero narrative with a transgender twist.