The Gospel of Pseudo-Matthew 1

Pseudonymously presented as a Hebrew work of the apostle Matthew translated by Jerome; the real author is unknown, a Latin compiler of about the 8th-9th century AD (the spurious letters that frame it are not included here). It combines the Protevangelium of James and the Infancy Gospel of Thomas with new stories, chiefly the flight into Egypt, where a palm tree bends down to feed the family and the idols fall. It is the earliest source of the ox and the ass at the manger, and it shaped the medieval nativity.
1In those days there was a man in Jerusalem, Joachim by name, of the tribe of Judah. He was the shepherd of his own sheep, fearing the Lord in integrity and singleness of heart. He had no other care than that of his herds, from the produce of which he supplied with food all that feared God, offering double gifts in the fear of God to all who laboured in doctrine, and who ministered unto Him. Therefore his lambs, and his sheep, and his wool, and all things whatsoever he possessed, he used to divide into three portions: one he gave to the orphans, the widows, the strangers, and the poor; the second to those that worshipped God; and the third he kept for himself and all his house. And as he did so, the Lord multiplied to him his herds, so that there was no man like him in the people of Israel. This now he began to do when he was fifteen years old. And at the age of twenty he took to wife Anna, the daughter of Achar, of his own tribe, that is, of the tribe of Judah, of the family of David. And though they had lived together for twenty years, he had by her neither sons nor daughters.