A century ago, a learned Benedictine (Dom P. Cagin, in his Te Deum ou Illatio - Abbaye de Solesmes, 1906) proposed that the Te Deum is an expanded Preface (an Illatio) from the Gallican Liturgy. What if it is more than that?
As all men know, this magnificent hymn of praise consists of three sections, as the text and music thereof demonstrate: the first (Te Deum laudamus... Paraclitum Spiritum) is in worship of God the Father, praising Him and introducing the angels singing the Sanctus, then allowing the saints and the Church to join in, praising the entire Trinity; the second part (Tu Rex gloriæ Christe... in gloria numerari) is in adoration of Christ as our Saviour, the Eternal Son Who abhorred not the Virgin's womb, and by His victory over death opened the gates of heaven to us, redeemed by His Precious Blood, who hope to be judged worthy of life with Him in glory; and the third section, considered to have been added later, is a catena of psalm verses (Salvum fac populum... in æternum) supplicating aid for us sinners who seek ever to praise God.
However, there are - it seems to me - two lacunæ in the Te Deum, marked by sudden leaps of thought, and one of these is not remarked upon. The first of these is at the end of the first section, where, having confessed the Trinity, ending with the Holy Ghost, we move on at once to addressing the Son. Some would have it that the Holy Ghost has been added in here to what was an earlier mention of the Father and Son only; but there may be another explanation... The second of these gaps is within the section devoted to the Son: no sooner is Christ confessed as not having abhorred the Virgin's womb, than He is praised as the Victor over death - what of the course of His earthly life, and above all His one sacrifice on Calvary?
Now if, as Dom Cagin theorized, the Te Deum is an expanded Preface, then the Preface proper stretches from the opening words down to the start of the Sanctus: so we have the initial address to God (Te Deum... Te æternum Patrem...) and then the description of the angels worshipping Him (Tibi omnes Angeli, tibi cæli et universæ potestates. Tibi Cherubim et Seraphim incessabili voce proclamant:). Next comes the Sanctus itself, in the Gallican form with majestatis gloriæ tuæ. But the whole rest of the hymn would then correspond with the Canon of the Mass - with the Illatio or Anaphora (the two words mean much the same), which, at least in Mozarabic Spain, was considered to continue after the Sanctus down to the Consecration...
If the Te Deum from Te gloriosus Apostolorum chorus onwards is a fragment of a Eucharistic Prayer, then, what does it contain, and what does it lack? It certainly has a fine exordium, taking up the theme of the angelic choirs adoring the Lord by bringing in the apostles, prophets, martyrs and the whole Church throughout the world now lauding the Trinity. Then it has part of what is styled the memorial or anamnesis, the recollection of Christ's mighty salvific works, addressed to Him as is the case in Syrian Anaphoras for example (recall that in the Gallican and Mozarabic Liturgies all prayers are indifferently addressed to the Father or to the Son, as a protest again Arianism and a confession of the divinity of Christ), and, like those Syrian formulæ, ending with mention of the fearful Last Judgement to come and a plea to escape hell and deserve heaven by reason of our trust in His all-availing Blood. However, this anamnesis only commemorates the Incarnation, Resurrection, and Ascension to the Father's Right. Finally, the whole concludes with intercession, albeit in a series of psalm verses that appear to be a later addition to the hymn (perhaps in place of a longer and more obviously Eucharistic impetration?).
What then is lacking from the Te Deum if considered a putative Eucharistic Prayer? Three things above all: an epiclesis (which in the West was not always limited to an invocation of the Holy Ghost, and could be found before the words of the Lord, as also in the Alexandrian Rite), the words of the Lord in constituting the Sacrament, and the oblation of the Sacrifice in connexion with mention of His Passion.
Where would these elements have been found? My contention is that they would have fitted precisely in the two lacunæ I mentioned above: an epiclesis followed by the Verba Domini could easily have bridged the gap between Sanctum quoque Paraclitum Spiritum and Tu Rex gloriæ Christe, while the anamnesis could have been completed and linked to the oblation of the Sacrifice by a no longer extant statement recalling Christ's Passion and the Eucharist as our offering thereof.
Here is a reconstruction, very tentative, according to my theory:
TE DEUM AS AN ILLATIO
Te, Deum, laudamus:
te, Dominum, confitemur.
Te, aeternum Patrem,
omnis terra veneratur.
Tibi omnes Angeli;
tibi caeli et universae Potestates;
Tibi Cherubim et Seraphim
incessabili voce proclamant:
Sanctus, Sanctus, Sanctus,
Dominus Deus Sabaoth.
Pleni sunt caeli et terra
majestatis gloriae tuae.
Te gloriosus Apostolorum chorus,
Te Prophetarum laudabilis numerus,
Te Martyrum candidatus laudat exercitus.
Te per orbem terrarum
sancta confitetur Ecclesia,
Patrem immensae maiestatis:
Venerandum tuum verum et unicum Filium;
Sanctum quoque Paraclitum Spiritum.
[Emitte eum, Domine:
[et benedic hæc sancta sacrificia,
[ut nobis fiant Corpus et Sanguis dilecti Filii.]
ANAMNESIS [& OBLATION]
Tu Rex gloriae, Christe.
Tu Patris sempiternus es Filius.
Tu ad liberandum suscepturus hominem,
non horruisti Virginis uterum.
[Tu victima semel immolatus in ara crucis,
[Tu hostia semper vivens,
[Te offerimus Patri æterno.]
Tu, devicto mortis aculeo, aperuisti
credentibus regna caelorum.
Tu ad dexteram Dei sedes, in gloria Patris.
Judex crederis esse venturus.
Te ergo quaesumus, tuis famulis subveni:
quos pretioso sanguine redemisti.
Aeterna fac cum sanctis tuis in gloria numerari.
Salvum fac populum tuum,
Domine, et benedic hereditati tuae.
Et rege eos, et extolle illos usque in aeternum.
Per singulos dies benedicimus te;
Et laudamus Nomen tuum in saeculum, et in saeculum saeculi.
Dignare, Domine, die isto sine peccato nos custodire.
Miserere nostri domine, miserere nostri.
Fiat misericordia tua,
Domine, super nos, quemadmodum speravimus in te.
In te, Domine, speravi:
Non confundar in æternum.
Remember, this is just an amateur's theory!