161 Yevamot 12/5-6

(ה) חָלְצָה בִשְׁנַיִם, אוֹ בִשְׁלֹשָׁה, וְנִמְצָא אֶחָד מֵהֶן קָרוֹב אוֹ פָסוּל, חֲלִיצָתָהּ פְּסוּלָה. רַבִּי שִׁמְעוֹן וְרַבִּי יוֹחָנָן הַסַּנְדְּלָר מַכְשִׁירִין. וּמַעֲשֶׂה בְאֶחָד שֶׁחָלַץ בֵּינוֹ לְבֵינָהּ בְּבֵית הָאֲסוּרִין, וּבָא מַעֲשֶׂה לִפְנֵי רַבִּי עֲקִיבָא וְהִכְשִׁיר:

(ו) מִצְוַת חֲלִיצָה. בָּא הוּא וִיבִמְתּוֹ לְבֵית דִּין, וְהֵן מַשִּׂיאִין לוֹ עֵצָה הַהוֹגֶנֶת לוֹ, שֶׁנֶּאֱמַר, (דברים כה) וְקָרְאוּ לוֹ זִקְנֵי עִירוֹ וְדִבְּרוּ אֵלָיו. וְהִיא אוֹמֶרֶת, מֵאֵן יְבָמִי לְהָקִים לְאָחִיו שֵׁם בְּיִשְׂרָאֵל, לֹא אָבָה יַבְּמִי. וְהוּא אוֹמֵר, לֹא חָפַצְתִּי לְקַחְתָּהּ. וּבִלְשׁוֹן הַקֹּדֶשׁ הָיוּ אוֹמְרִים. וְנִגְּשָׁה יְבִמְתּוֹ אֵלָיו לְעֵינֵי הַזְּקֵנִים וְחָלְצָה נַעֲלוֹ מֵעַל רַגְלוֹ וְיָרְקָה בְּפָנָיו, רֹק הַנִּרְאֶה לַדַּיָּנִים. וְעָנְתָה וְאָמְרָה כָּכָה יֵעָשֶׂה לָאִישׁ אֲשֶׁר לֹא יִבְנֶה אֶת בֵּית אָחִיו, עַד כָּאן הָיוּ מַקְרִין. וּכְשֶׁהִקְרָא רַבִּי הֻרְקְנוֹס תַּחַת הָאֵלָה בִּכְפַר עֵיטָם וְגָמַר אֶת כָּל הַפָּרָשָׁה, הֻחְזְקוּ לִהְיוֹת גּוֹמְרִין כָּל הַפָּרָשָׁה. וְנִקְרָא שְׁמוֹ בְּיִשְׂרָאֵל בֵּית חֲלוּץ הַנָּעַל. מִצְוָה בַדַּיָּנִין, וְלֹא מִצְוָה בַתַּלְמִידִים. רַבִּי יְהוּדָה אוֹמֵר, מִצְוָה עַל כָּל הָעוֹמְדִים שָׁם לוֹמַר, חֲלוּץ הַנָּעַל, חֲלוּץ הַנָּעַל, חֲלוּץ הַנָּעַל:

(5) [If] a [Yevamah] performed Chalitzah before [a court of] two, or [if] she performed Chalitzah before three but one of them is found to be a relative or ineligible [to serve as a judge] her Chalitzah is invalid. Rabbi Shimon and Rabbi Yochanan HaSandlar deem it valid. It happened once that a man underwent Chalitzah from a woman when they were alone in prison, and when the case came before Rabbi Rabbi Akiva, he deemed it valid.

(6) The Mitzvah of Chalitzah [is as follows]: He [the Yavam] and his Yevamah come to a court and they advise him according to circumstances, for it is said, "And the elders of his city shall call him, and speak to him," (Devarim 25:8), and she says, "My husband's brother refuses to raise up for his brother a name in Israel; he will not perform for me the duty of a husband's brother" (Devarim 25:7). And he says, "I do not wish to take her" (Devarim 25:8). And they would recite [these statements] in the Holy language [Hebrew]. "Then shall the brother's wife approach him in the presence of the elders and loosen his shoe from his foot, and spit before him" (Devarim 25:9) - spit that can be seen by the judges. "And she shall respond and say, 'So shall it be done to the man who will not build up his brother's house'" (Devarim 25:9). This is as far as they read, but when Rabbi Hurcanus had [the text] read under the terebinth in the village of Etam, and had the passage completed, it became customary to read the whole passage. "And his name shall be called in Israel 'The house of him who had his shoe loosed'", (Devarim 25:10). It is a Mitzvah upon the judges but it is not a Mitzvah upon the students. Rabbi Yehudah says: It is a Mitzvah upon all standing there to state, "The man who had his shoe loosed! The man who had his shoe loosed! The man who had his shoe loosed!"