NEW YORK -- After years of painful soul searching, Rhiannon O'Donnabhain -- a former construction engineer from a devout Irish Catholic family in Boston -- decided to surgically change his sex to female in 2001. The struggle was equally tough financially -- hormone treatments and medical procedures set her back $25,000, a burden she felt could be partially offset by taking a $5,000 tax deduction for medical costs.

When she sent in her tax claims after the surgery, the Internal Revenue Service initially issued the 64-year-old former Coast Guard reservist a refund check for $5,000. But soon after, she was audited and ordered to return the refund because the IRS had determined that her surgery had been merely "cosmetic" -- and therefore not tax deductible.

Rather than return the money, O'Donnabhain opted to sue the IRS. The result has been a riveting case -- the first of its kind in normally staid U.S. Tax Court -- in which lawyers have just concluded oral arguments and are set to present a new round of written briefs next month. The core question is this: Should changing your sex be tax deductible?

The answer, according to leading medical experts, is an unequivocal yes. In fact, O'Donnabhain's treatment by the government has sparked outrage among medical professionals who specialize in gender identity disorder, a condition that leads an estimated 1,000 to 2,000 Americans a year to undergo sex-change operations.

"When did the IRS suddenly become physicians?" said Marshall Forstein, associate professor of psychiatry at Harvard Medical School. "It's absolutely clear that transgender identity is a condition discussed in diagnostic manuals. It seems the IRS is now in the business of practicing medicine without a license."

According to O'Donnabhain's lawyers from the Massachusetts-based Gay and Lesbian Advocates and Defenders (GLAD), the case is expected to set a precedent on whether such procedures will be considered tax deductible.

U.S. tax laws do allow deductions for a broad array of medical treatments. An IRS spokesman declined to comment on the O'Donnabhain case, citing the pending litigation. When questioned about what types of medical procedures are tax deductible, he pointed a reporter to an IRS publication that contains a rundown of eligible expenses.

The publication defines deductible medical expenses as "the costs of diagnosis, cure, mitigation, treatment, or prevention of disease, and the costs for treatments affecting any part or function of the body . . . [to] . . . primarily alleviate or prevent a physical or mental defect or illness."

Among the things that are tax deductible: abortions, inpatient alcohol treatment programs, the purchase of artificial teeth, chiropractic care, birth control pills and vasectomies, to name a few. Sex readjustment surgery, however, is not mentioned in the IRS literature.

O'Donnabhain and her lawyers have argued that the IRS's change of heart in issuing her a refund effectively amounted to a political decision, perhaps even a moral judgment.

"All I want is to be treated like anybody else," she said in a statement.

O'Donnabhain's problems with the IRS come at a time when she is still trying to adjust to life as a woman. According to a statement she supplied, she began having misplaced feelings about her gender as early as elementary school. A life as a Coast Guard reservist, marriage and the fathering of three children did nothing to reverse those feelings. She was diagnosed with gender identity disorder after seeing a therapist in 1996. In the years leading up to her sex-change operation in 2001, she went through years of intensive counseling and hormone treatments.

"If you have bunions on your feet and it makes it hard for you to walk, that's covered, but something as broad-based as gender identity disorder is not?" said Bennett Klein, a GLAD lawyer representing O'Donnabhain. "I think what's clear here is that the IRS is making a political decision on what should have been an obvious medical deduction. You can't set different standards for a person's health; IRS agents should not be in a position of second-guessing health-care professionals."