This week a doctor in India was sentenced to two years in jail for testing the sex of an unborn child and then agreeing to abort it because it was a girl. An estimated 10 million female fetuses may have been aborted in India over the last 20 years. Indian law prohibits abortion for the sole reason that the fetus is a female. There are other ways to select the preferred sex of a child, but they are also controversial.

What would you do if you had three boys but also wanted a girl? Or vice versa?

In many countries, couples already select the sex of their children, most commonly through abortion.

In China as well as in India the desire for baby boys has led to pronounced gender imbalances. But abortion is not the only way to ensure the sex of newborns.

Couples can choose to undergo a medical procedure called pre-implantation genetic diagnosis or PGD. PGD is 100 percent accurate.

John and Kristin Magill used it to add their twin boys to a family that already included three girls.

The Magills conceived their daughters naturally, but used PGD to have their sons.

With PGD, couples provide doctors with sperm and egg samples. After the eggs are fertilized, the embryos are screened for gender before being implanted in the womb. This procedure was developed to help couples who carry genetic disorders to have healthy children.

Diane Rinaldi and her husband used PGD.

"If is wasn't for this procedure, I really believe we wouldn't have a baby," said Diane.

PGD tests embryos for disease by looking for defective chromosomes.

For example, PGD can help a couple avoid having a baby suffering from rhesus factor disease -- the potentially fatal condition caused by incompatibility between a baby's blood and that of its mother.

But avoiding disease and genetic defects is not why most couples interested in PGD seek the help of fertility specialists such as Dr. Jeffrey Steinberg.

"We're coming up on 2,000 couples now, that we've done PGD on. Eighty-five to 90 percent of those couples have done it simply for gender selection," said Dr. Steinberg.

Which disturbs Dr. Mark Hughes. He is one of the pioneers of this procedure. "I went into science and into medicine to diagnose and treat, and hopefully, cure disease. And the last time I checked, gender was not a disease."

Gender selection is banned in a large number of countries. But not in the United States. A study conducted by the Johns Hopkins University Genetics and Public Policy Centershows that about 40 percent of Americans approve the use of genetic testing to determine the sex of their future children, Kristin Magill included.

"I think it's a good opportunity for a family in the same situation as us,” she said.

The procedure is costly - $18,000 for just one try.

But there is also a much less expensive method that involves sperm-sorting and artificial insemination. Here's how it works: a sperm sample is treated with a special dye. The X sperm, which produce females, are brighter and heavier so sperm can be sorted by color and weight.

With this technique, 9 out of 10 couples who want a girl get one and 7 out of 10 couples get the boy they want.

No one knows how many couples are using PGD or other gender selecting technologies.

In the United States there does not seem to be a preferred gender according to Susannah Baruch from the Genetics and Public Policy Center. "We don't have any statistics about whether one sex is preferred over the other,” she says, “but anecdotal evidence shows it is being used more or less equally between boys and girls."

She says choosing the sex of your child raises other ethical concerns.

"There have been objections to sex selection on the grounds that it reinforces gender discrimination and gender stereotypes. That's one ethical concern. Another is that it changes the relationship between parents and children by allowing parents to choose something about their child that would otherwise happen naturally."

The Genetics and Public Policy Center is now gathering data to find out how often couples choose the sex of their children.