A lord is preparing to wed. His bride seeks to conceal the fact that she is not a virgin, but the truth -- that she had once slept with a lord in a wood -- comes out. It is then revealed that the man she slept with was her husband-to-be.
Sir Walter Scott's version of this (Child's B) names the hero "Cospatrick," which Scott lists as the name of the Earl of Dunbar around the time of Edward I of England. The name was still used in Child's time for members of the Dunbar line.
The name, however, is older; Rosalind Mitchison, _A History of Scotland_ (second edition,1983, p. 16) mentions a Cospatrick who was apparently a Saxon claimant to one or another northern English earldom in 1069, and whose son held Cumberland until William II of England conquered it in 1092. It seems unlikely that any of this has a genuine connection to the ballad.
Again, several instances of the ballad mention violence by the groom against the bride on their wedding night; this sounds much like the Thousand and One Nights, but there is unlikely to be a direct connection. - RBW