The Protoevangelium of James
"And behold, an angel of the Lord stood by [St. Anne], saying, Anne! Anne! The Lord has heard your prayer, and you shall conceive and shall bring forth, and your seed shall be spoken of in all the world. And Anne said, As the Lord my God lives, if I beget either male or female, I will bring it as a gift to the Lord my God, and it shall minister to him in the holy things all the days of its life. . . . And [from the time she was three] Mary was in the temple of the Lord as if she were a dove that dwelt there" (Protoevangelium of James 4, 7 [A.D. 120]).
"And when she was twelve years old there was held a council of priests, saying, Behold, Mary has reached the age of twelve years in the temple of the Lord. What then shall we do with her, lest perchance she defile the sanctuary of the Lord? And they said to the high priest, You stand by the altar of the Lord; go in and pray concerning her, and whatever the Lord shall manifest to you, that also will we do. . . . [A]nd he prayed concerning her, and behold, an angel of the Lord stood by him saying, Zechariah! Zechariah! Go out and assemble the widowers of the people and let them bring each his rod, and to whomsoever the Lord shall show a sign, his wife shall she be. . . . And Joseph [was chosen]. . . . And the priest said to Joseph, You have been chosen by lot to take into your keeping the Virgin of the Lord. But Joseph refused, saying, I have children, and I am an old man, and she is a young girl" (ibid., 89).
"And Annas the scribe came to him [Joseph] . . . and saw that Mary was with child. And he ran away to the priest and said to him, Joseph, whom you did vouch for, has committed a grievous crime. And the priest said, How so? And he said, He has defiled the virgin whom he received out of the temple of the Lord and has married her by stealth" (ibid., 15).
"And the priest said, Mary, why have you done this? And why have you brought your soul low and forgotten the Lord your God? . . . And she wept bitterly saying, As the Lord my God lives, I am pure before him, and know not man" (ibid.).