What is the origin of erlking?

Erlking “a spirit that works mischief” is an adaptation of German Erlkönig “alder king.” However, the word erlking is not of ultimate German origin; Erlkönig is in fact a mistranslation, courtesy of 18th-century poet Johann Gottfried von Herder, of Danish ellerkonge, a variant of elverkonge “elf king.” Elf has an interesting history, one full of semantic shifts over time. In Middle English, elf could denote one of a multitude of supernatural entities, including fairies, goblins, incubi, succubi, and spirits in general. Cognates in other Germanic languages include German Alb “elf, nightmare” and Old Norse alfr “elf,” the latter of which was borrowed into English as oaf, and names derived from this “elf” root include Alfred, Alvin, Aubrey, Gandalf, Oberon, and even Oliver. Though the Indo-European origin of all these words is uncertain, the most promising hypothesis—based on a potential definition of “white apparition” or “white ghost”—is a connection to the Proto-Indo-European root albhos “white”; compare Latin albus “white” (as in albedo, albino, and Albus Dumbledore). Erlking was first recorded in English in the 1790s.