A person's sex no longer has any bearing on the possibility of entering into marriage. The Marriage Code and other statutes involving spouses have been made gender-neutral and the Registered Partnership Act (1994:1117) has been repealed. The new legislation about new rules concerning marriage and marriage cermonies is described briefly in this PDF.
Document link: Gender-neutral marriage and marriage ceremonies