It is most likely that the "Codex Calixtinus" was written in stages in Santiago during the tenure of Archbishop Diego Gelmírez.It is organized into 5 books, each complemented with documents and additions.
Book I contains the liturgy for the Mass and Divine Office of the Saint James festivities. Most of this first book is attributed to Pope Callixtus II, from whom the work as a whole takes its name. It contains 22 polyphonic compositions, which were a novelty in Europe at the time. Book II details the miracles of Saint James and includes a hymn for pilgrims to Compostela, called "Dum Pater Familias." Book III gives an account of the transferral of Saint James' remains from Jaffa in Israel to Santiago de Compostela. Book IV is also known as "Pseudo-Turpin" in reference to Turpin, Archbishop of Reims (believed to be its author), and relates the Charlemagne's exploits in Spain. From 1619 to 1966 it was separated from the manuscript, forming a volume of its own and undergoing several modifications. Finally, Book V is the "Pilgrim's Guide" and includes a description of the cathedral at the time that it was written. This is attributed to Callixtus II and his chancellor, Aymeric Picaud.