Though Ms. Dolan does not mention her gender transition to clients, she said, she believes that her background has helped her better represent them, particularly those who have lived on the margins.

“While I may not know specifically what it’s like to be in their shoes,” she said, “I do understand what it means and how it feels to be marginalized.”

The number of openly transgender lawyers in the United States is perhaps in the hundreds, said M. Dru Levasseur, director of the Transgender Rights Project at Lambda Legal, who knows Ms. Dolan and calls her a “fierce advocate.”

Other lawyers agree. “She’s a trailblazer — she is who she is, and she doesn’t dance around it,” said Martin R. Stolar, who has defended clients with Ms. Dolan. “It’s just a wonderful attitude.”

Diversity in the bench and the bar has long been a widely held goal; in New York, for example, Senator Charles E. Schumer, whose office recommends judicial appointments to the White House, has regularly focused on adding women and minorities, including gay men and lesbians, to the federal bench.

But how diversity plays out in individual court cases is less frequently examined. Two professors of legal ethics said that Ms. Dolan had no obligation to inform her clients of her gender transition and that they had no right to know about it.

“The Constitution guarantees the effective assistance of counsel only,” said Stephen Gillers, of New York University School of Law. “Sexual identity, like race, ethnicity and religion, has no bearing on whether a lawyer will be effective.”