There are earlier elements that contributed to the tale.
The second half, in which the princess and her children are almost put to death, but instead hidden, may have been influenced by Genevieve of Brabant [REF].