The 37th mitzvah is that we are commanded that Kohanim shall make themselves tameh for those relatives mentioned in the Torah. Since the Torah honored them by prohibiting them from being tameh from a dead body alone, and allowed them to become tameh for relatives, one could possibly think that it is optional and depends on their wishes: if they wish, they may become tameh, and if not, they will not become tameh. The Torah therefore explicitly decreed that it is a requirement.
The source of this commandment is G‑d's statement (exalted be He), [regarding the kohen's sister], "You shall become tameh for her."
The Sifra says, "The phrase, 'You shall become tameh for her,' is a positive commandment. Even should he not want to become tameh, he is made tameh against his will. The wife of Yosef HaKohen passed away on Erev Pesach, and he did not want to become tameh, and the Sages forced him to become tameh against his will."
This mitzvah is actually the commandment to mourn, i.e. that every Jew is required to mourn upon the passing of one of the six for who it is commanded to mourn. The commandment is said regarding a kohen to emphasize its seriousness: Even a kohen, who is normally forbidden from becoming tameh, is commanded in this case to act like any other Jew and become tameh. [It is stressed in this way] in order to prevent people from being lenient in the laws of mourning.
It has been explained that the first day of mourning is mandated by Torah law. Our Sages said in tractate Moed Katan, "The commandment of mourning does not apply during Yom Tov. If the person was already mourning [when Yom Tov began], the positive commandment which applies to everyone [i.e. rejoicing during Yom Tov] pushes away the positive commandment which applies only to the individual" [i.e. mourning]. This [phrase "positive commandment"] indicates clearly that mourning is a Torah obligation and counts as a positive commandment. However, this is only for the first day, when even a kohen becomes tameh upon the passing of a close relative. The seven days of mourning are by Rabbinic law. Be sure to understand this.
The details of this mitzvah are explained in tractate "Mashkin," passages in Berachos, Kesuvos, Yevamos, and Avodah Zorah, and in Sifra, Parshas Emor el HaKohanim.
The requirement of Kohanim to become tameh for a close relative is not binding upon female Kohanim. Only one who is prohibited from becoming tameh for non-relatives is commanded to become tameh for relatives. A female kohen, since she is not prohibited from tumas meis, as explained there, she is also not commanded or required to become tameh [upon death of a relative]. She is required to mourn, but becoming tameh is her choice. Be sure to understand this.