The German libretto was written by the composer . He was adapting a story by Carlo Gozzi called La donna serpente . The German libretto was written by the composer after Carlo Gozzi 's La donna serpente .