Isaiah 40:3-5: "A voice cries: 'In the wilderness prepare the way of the LORD; make straight in the desert a highway for our God. Every valley shall be lifted up, and every mountain and hill be made low; the uneven ground shall become level, and the rough places a plain. And the glory of the LORD shall be revealed, and all flesh shall see it together, for the mouth of the LORD has spoken.'"
Matthew 21:1-11: "Now when they drew near to Jerusalem and came to Bethphage, to the Mount of Olives, then Jesus sent two disciples, saying to them, 'Go into the village in front of you, and immediately you will find a donkey tied, and a colt with her. Untie them and bring them to me. If anyone says anything to you, you shall say, "The Lord needs them," and he will send them at once.' This took place to fulfill what was spoken by the prophet, saying, 'Say to the daughter of Zion, "Behold, your king is coming to you, humble, and mounted on a donkey, and on a colt, the foal of a beast of burden."' The disciples went and did as Jesus had directed them. They brought the donkey and the colt and put on them their cloaks, and he sat on them. Most of the crowd spread their cloaks on the road, and others cut branches from the trees and spread them on the road. And the crowds that went before him and that followed him were shouting, 'Hosanna to the Son of David! Blessed is he who comes in the name of the Lord! Hosanna in the highest!' And when he entered Jerusalem, the whole city was stirred up, saying, 'Who is this?' And the crowds said, 'This is the prophet Jesus, from Nazareth of Galilee.'"
Psalm 24:7-10: "Lift up your heads, O gates! And be lifted up, O ancient doors, that the King of glory may come in. Who is this King of glory? The LORD, strong and mighty, the LORD, mighty in battle! Lift up your heads, O gates! And lift them up, O ancient doors, that the King of glory may come in. Who is this King of glory? The LORD of hosts, he is the King of glory!"
Isaiah 9:6-7: "For to us a child is born, to us a son is given; and the government shall be upon his shoulder, and his name shall be called Wonderful Counselor, Mighty God, Everlasting Father, Prince of Peace. Of the increase of his government and of peace there will be no end, on the throne of David and over his kingdom, to establish it and to uphold it with justice and with righteousness from this time forth and forevermore. The zeal of the LORD of hosts will do this."
+++
The text is public domain:
Prepare the royal highway;
The King of kings is near!
Let ev'ry hill and valley
A level road appear!
Then greet the King of Glory
Foretold is sacred story:
Hosanna to the Lord,
For He fulfills God's Word!
God's people, see Him coming:
Your own eternal king!
Palm branches strew before Him!
Spread garments! Shout and sing!
God's promise will not fail you!
No more shall doubt assail you!
Hosanna to the Lord,
For He fulfills God's Word!
Then fling the gates wide open
To greet your promised king!
Your king, yet ev'ry nation
Its tribute too should bring.
All lands, bow down before Him!
All nations, now adore Him!
Hosanna to the Lord,
For He fulfills God's Word!
His is no earthly kingdom;
It comes from heav'n above.
His rule is peace and freedom
And justice, truth, and love.
So let your praise be sounding
For kindness so abounding:
Hosanna to the Lord,
For He fulfills God's Word!
+++
The Biblical texts are pretty clearly divided into the verses here. The Isaiah 40 text, with its "prepare the way of the LORD" and "the uneven ground shall become level, and the rough places a plain," is the basis for the first verse. The crowd's shouting and strewing branches and cloaks in Matthew 21 is described in the second verse. The opening gates in Psalm 24 are at the beginning of the third verse, and some of the attributes listed in Isaiah 9 appear in the fourth verse.
The first line of the refrain ("Hosanna to the Lord") also comes from the Matthew 21 text.