Gender is an essential characteristic of individual premortal, mortal, and eternal identity and purpose.
I was reading the other day about children born with both male and female genitalia. According to the World Health Organization, about 5 such children are born every day in the United States (about 1 in 2000 births). Almost always, such children are "assigned" to be males, with attendant surgical removal of internal and external female genitalia, and this is usually based on the arbitrary decision of the parents. Some studies have shown that basing such gender assignment on visible external genitalia is problematic and that, more often than not, the hormonal and other makeup of the person is actually female.
So, my question is this: if a premortal female spirit is given a body with male and female genitalia, and the parents decide to make her a "boy," how does this affect the child's eternal destiny? Say the boy grows up, is ordained to the priesthood, serves a mission, and is married in the temple? Does the female spirit then become a male spirit? Is this "corrected" in the afterlife, with the sealing canceled and the priesthood withdrawn?