In 1887, James R. Murray published this verse and called it "Luther's Cradle Hymn, composed by Martin Luther for his children, and still sung by German mothers to their little ones." Incidentally, Martin Luther, the famous father of the Reformation, was not the author, nor was Murray. The origin is a children's Sunday school book published a few years before Murray's attribution. The verses have been set to a number of tunes, but this arrangement is set to Murray's own tune, called "Mueller."
Sheet music available at https://music.justinreeve.com/away-in-a-manger/