sentences:  It was for a long time the residence of the Warden of the Middle Marches and used as a prison.In 1515, Margaret Tudor, the widowed queen of King James IV of Scotland and sister of King Henry VIII of England, having been banished by the regent, John Stewart, Duke of Albany, came to the castle with her second husband, Archibald Douglas, 6th Earl of Angus.There, their daughter was born, who was also called Margaret.