So I get married and then use a Fantasia to change my sex.

Will the marriage(and its perks) still be valid?