A federal judge in Boston on Tuesday ordered the Massachusetts Department of Correction to provide an inmate with a sex change. Doctors for Michelle L. Kosilek, a transsexual prisoner who was convicted of murdering his wife in 1990, say gender reassignment surgery is the only way to treat his severe gender identity disorder. Corrections officials had denied the surgery, saying that it could create security problems. In his decision, Judge Mark L. Wolf found that the denial of the surgery, which would be financed with state taxes, amounted to a violation of the Eighth Amendment, which prohibits cruel and unusual punishment. He is believed to be the first federal judge to order gender reassignment. Mr. Kosilek is serving a life sentence without parole. He sued the Department of Corrections over the matter in 2000.