session CHANGE libyang changes
diff --git a/src/session_server.c b/src/session_server.c
index 8205332..90e076e 100644
--- a/src/session_server.c
+++ b/src/session_server.c
@@ -334,12 +334,13 @@
         return NULL;
     }
 
-    data = lyd_output_new_anyxml_str(sdata, model_data);
+    data = lyd_new_path(NULL, server_opts.ctx, "/ietf-netconf-monitoring:get-schema/data", model_data, LYD_PATH_OPT_OUTPUT);
     if (!data) {
         ERRINT;
         free(model_data);
         return NULL;
     }
+    free(model_data);
 
     return nc_server_reply_data(data, NC_PARAMTYPE_FREE);
 }