Auto-translated
The Nutcracker was written by Ernst Theodor Amadeus Hoffmann, what a coincidence. And yes, it was Andersen who wrote about the swineherd, I was right at first. Only in his story, the princess simply kissed him, while in Kosha's version, she just... embellished everything.