I first came across this story in Old Celtic Romances by P W Joyce. This is a frequently retold ancient Irish story with the oldest versions found in medieval manuscripts, which are considered part of a large grouping of stories known as the Mythological Cycle. The manuscripts of the Mythological Cycle are based on even older ones and oral versions now lost, but recorded by early Christian monks about pre-christian myths and stories. Modern scholars are very cautious about these early tales and do not regard them as accurate accounts of pre-christian beliefs or stories but even so they probably give a flavour of early Irish myth and stories. Lir is a king (originally a god but in the story one of the immortal Tuatha de Danann, who do not age but can die from illness or wound) who has four children, a girl and three boys to his first wife. After she dies Lir marries her sister or foster sister Aoife. Aoife becomes jealous of Lir's love of his children and uses magic to try to slay them. Instead of dying they are transformed into swans, who retain their voices and make beautiful music, bringing peace and tranquillity when in contact with the citizens of Ireland but are doomed to spend a total of nine hundred years split between a lake and two wild and stormy seas. After their exile is complete they can only return to their true forms when a woman of the South marries a man of the North. After nine hundred years they return to their father’s palace to find only deserted weed covered mounds. In their absence a new people the Milesians have come to Ireland and their own people have “withdrawn behind a veil” and have become invisible. The new people have converted to Christianity and a kindly hermit becomes the swans protector, until they are dragged forcibly away as a wedding gift for a princess of the south from a prince of the north. The children of Lir return to their true form tragically not as immortal children but aged mortal humans. This being a tale told by monks the hermit baptises them as they die from extreme old age, so that they can go to heaven.
Most modern versions are based on the 19th century translation Oiḋe ċloinne Lir or The fate of the children of Lir, translated by Richard O’Duffy, which was influenced by a paper published in the journal Atlantis by Eugene O’Curry, which contained the Children of Lir as a translation and in the original Irish. This is a coherent tale compiled from fragments found in different old manuscripts. Similar 19th century translations are available in Gods and fighting men : the story of the Tuatha de Danaan and of the Fiana of Ireland by Lady Augusta Gregory and as mentioned above Old Celtic Romances by P W Joyce. A more recent less literary, academic translation from the University College Cork can be found online. It was popularised in the 19th century by a retelling being included in More Celtic Fairy Tales by Joseph Jacobs. More modern retellings are commonly available as books or online. Swan transformations crop up fairly often in fairy tales either as a means of gaining a wife or perhaps more relevant to the Children of Lir wicked step-mothers transforming their step-children. Well known examples of this theme are the brothers Grimm story The Six Swans, The Wild Swans by Hans Christian Andersen or the medieval Knight of the Swan. Children Of Lir contains the murderous step-mother motif familiar in many fairy tales (The Grimms tell several less well-known ones such as the grim in all senses of the word The Almond Tree), perhaps the most well-known fairy tale dysfunctional step-parent step-child relationship is found in Snow White.