Gospel of Pseudo-Matthew

The Gospel of Pseudo-Matthew is a part of the New Testament apocrypha, and sometimes goes by the name of The Infancy Gospel of Matthew, but the actual name of the text in antiquity was The Book About the Origin of the Blessed Mary and the Childhood of the Savior. Pseudo-Matthew is one of a genre of "Infancy gospels" that seek to fill out the details of the life of Jesus of Nazareth up to the age of 12, which are briefly given in the Gospels of Matthew and Luke. In the West, it was the dominant source for pictorial cycles of the Life of Mary, especially before the Late Middle Ages. 
Composition date.
According to the research of J. Gijsel / R. Beyers (1997) the archetype of the Gospel of Pseudo-Matthew's Recensio-α dates to 800 AD and the composition date to the first half of the seventh century, maybe to around 600 and 625 AD. Gijsel furthermore points out that Joachims representation in Pseudo-Matthew is meant to evoke the model figure of a Merovingian nobleman, this one, according to Gijsel, being Dagobert I during his reign (629639). According to Berthold, the composition date of the Gospel of Pseudo-Matthew is around 650 AD at the earliest, due to the fact that it "shows literary dependence on Vita Agnetis of Pseudo-Ambrose", which itself was used in De Virginitate in 690 AD. According to G. Schneider, the Gospel of Pseudo-Matthew was composed in the 8th or 9th century during the Carolingian dynasty. Pseudo-Matthew shares many similarities with, and likely used as sources, the apocryphal Gospel of James and Infancy Gospel of Thomas.
Content.
The narrative is prefaced by a series of letters between the early Church father Jerome and the Bishops Comatius and Heliodorus. In these letters the Bishops request that Jerome translate a "Hebrew volume, written by the hand of the most blessed Evangelist Matthew," concerning the birth of the virgin mother and the infancy of Jesus. Though the work is attributed to St. Jerome, it is unlikely that St. Jerome actually wrote or translated it: "no one who is acquainted with the style of Jerome's letters will think this one authentic."
The author of the pseudo-Jerome letter claims he compiled and translated the work, taking care to "render it word for word, exactly as it is in the Hebrew, since it is asserted that it was composed by the holy Evangelist Matthew, and written at the head of his Gospel," though he expressed doubt as to their authenticity.
The first half of the narrative tells the story of St. Joachim and St. Anne, the parents of Mary; Joachim's sorrow and persecution on account of their lack of progeny, his exile and return to Anna with child, and the birth of Mary; her entering service as a temple virgin, her prayerful life and vow of chastity, and the choosing of Joseph as her husband and guardian upon her becoming too old to continue as a temple virgin; the Annunciation; Joseph's distress at finding her pregnant, and his eventual acceptance of her honesty; his and Mary's being tested in the temple, and the acceptance of the people in the temple of Mary's and Joseph's innocence.
The content of the text is primarily an edited reproduction of the Protevangelium of James, followed by an account of the Flight into Egypt (it is not known on what this is based), and subsequently an edited reproduction of the Infancy Gospel of Thomas. Essentially, it is a (fairly successful) attempt to merge these texts into a single work. To its sources, the Gospel adds the first known mention of an ox and a donkey being present at the nativity of Jesus. The work also helped popularize the image of a very young Mary and relatively old Joseph from the Gospel of James.
It had a strong influence in medieval thought, partly due to its inclusion in the Golden Legend. One of the consequences of this is the creation of derivative works, such as the Libellus de Nativitate Sanctae Mariae (), which consists of just the early part of the text concerning the birth of Mary. Another text to be based on Pseudo Matthew is the Syriac Infancy Gospel, which includes many supernatural embellishments.
Events described in the Gospel of Pseudo-Matthew inspired "The Cherry-Tree Carol".