This is #214 in the Child cannon (The Braes o Yarrow).The variant here is related to 214E. It should be noted that the words in Child (1882-1898)CPB (vol IV, p168) are slightly different in places. There are also similarities with 214F and 214G. According to Child's notes, all three of these were "Scotch Ballads, Materials for Border Minstrelsy" from the Abbotsford MS.,MS-ABS.
According to Scott, he managed to collect a variety of copies of
this ballad. The one presented seems to be a collation of Scott's. This
would explain the differences to the one in Child.
Minor observation regarding the name. Scott titles the ballad text
"The Dowie Dens of Yarrow" but titles the air "The Dowie Dens o'
Yarrow".
Regarding the the typeset score, I
have ignored the piano accompaniment that Scott also provided. The
linebreaks are also different.