Under Svein Forkbeard and Cnut the Great, when the Danish kings came to rule England, a body of royal housecarls was developed there, with institutions that were partly of Norse inspiration, and partly inspired by canon law ("see below"). But even after the Danish kings had lost England, housecarls continued to exist in Denmark. Such a group of royal retainers was still in place at the beginning of the 12th century, under Niels of Denmark, when, according to Danish historian Svend Aggesen, Aggesen's grandfather, a member of the retinue, was tried for the murder of a fellow housecarl. Svend Aggesen's account of the law governing Cnut the Great's housecarls in 11th century England (the "Witherlogh" or "Lex Castrensis") may reflect, in fact, those governing Danish housecarls in the 12th century. But, by the end of the 12th century, housecarls had probably disappeared in Denmark; they had transformed into a new kind of nobility, whose members no longer resided at the king's court.