Ian McKellen will officiate at Patrick Stewart's wedding

Ian McKellen is gearing up to officiate the wedding of "X-Men" costar and friend Patrick Stewart.

In other words, Magneto's marrying Professor X.

On the British talk show "The Jonathan Ross Show," the 73-year-old film, stage and TV actor announced that he'd be performing the marriage ceremony for Stewart, 72, and his fiancee, jazz singer Sunny Ozell, 35.

"I'm going to marry Patrick," "The Hobbit" actor said after the host listed out his and Stewart's various collaborations. "No, no. How else do you put that? I'm going to officiate at his wedding."

When asked how the actor would legally pull off such a feat, McKellen humbly replied: "I don't know. But in Massachusetts, in the middle of America somewhere, you get anybody along, a friend, and I read out the words, and Sunny and Patrick will then be married. I declare you man and wife." Watch him talk about it at the 10:40 mark in the video above.

Stewart and Ozell have been romantically linked since 2009. The state of Massachusetts offers a "one-day marriage designation" that people can obtain with $25 and a character reference. Um, how awesome would it be to have Gandalf marry you?! Anyway, this isn't McKellen's first time officiating nuptials. He's done it before in Britain.

"I've done it once before with two guys having a civil partnership," he said. "I was crying my eyes out."

The charmer added he looked "fetching" when he wore a white gown he bought in India to the ceremony.

McKellen also discussed being gay in the 1950s and fielded criticisms about literature versus cinema (we're looking at you, "The Hobbit"). He's currently costarring in the comedy series "Vicious" with Derek Jacobi, who didn't fancy him when they first met in the 1950s despite McKellen's huge crush on the other actor. The series is about an elderly gay couple who've been living together for 48 years "and they're perfectly horrible to each other," McKellen said.

"X-Men: Days of Future Past," which also stars Halle Berry and Hugh Jackman, hits theaters July 18, 2014. McKellen and Stewart will also appear on Broadway together this fall in the revivals of "No Man's Land" and "Waiting for Godot."