St. Margaret of Scotland (c.1045-1092) was the granddaughter of the English king Edmund Ironside, and was married to Malcolm III, King of Scotland. In her position as Queen, Margaret promoted religious works, including the founding several churches. Her biographer, Turgot, bishop of St. Andrews (d.1115) mentions many of her pious deeds, including her ransoming of English captives in the later part of the eleventh century.
Chapter 3, Section 25: But who can tell the number of English of all ranks, carried captive from their own land by violence of war and reduced to slavery, whom she restored to liberty by paying their ransom? Spies were employed by her to go secretly through all the provinces of Scotland and ascertain what captives were oppressed with the most cruel bondage, and treated with the greatest inhumanity. When she had privately ascertained where these prisoners were detained, and by whom ill-treated, commiserating them from the bottom of her heart, she took care to send them speedy help, she paid their ransom and set them at liberty forthwith.
This text is from Life of St. Margaret, Queen of Scotland, translated by William Forbes-Leith (Edinburgh, 1884).