diff --git a/src/printer_xml.c b/src/printer_xml.c
index b1d187c..2e5182e 100644
--- a/src/printer_xml.c
+++ b/src/printer_xml.c
@@ -32,7 +32,7 @@
  * @brief XML printer context.
  */
 struct xmlpr_ctx {
-    struct lyp_out *out;  /**< output specification */
+    struct ly_out *out;  /**< output specification */
     unsigned int level; /**< current indentation level: 0 - no formatting, >= 1 indentation levels */
     int options;        /**< [Data printer flags](@ref dataprinterflags) */
     const struct ly_ctx *ctx; /**< libyang context */
@@ -89,7 +89,7 @@
 
     if (i == -1) {
         /* suitable namespace not found, must be printed */
-        lyp_print(ctx->out, " xmlns%s%s=\"%s\"", new_prefix ? ":" : "", new_prefix ? new_prefix : "", ns);
+        ly_print(ctx->out, " xmlns%s%s=\"%s\"", new_prefix ? ":" : "", new_prefix ? new_prefix : "", ns);
 
         /* and added into namespaces */
         if (new_prefix) {
@@ -144,7 +144,7 @@
             /* we have implicit OR explicit default node, print attribute only if context include with-defaults schema */
             mod = ly_ctx_get_module_latest(node->schema->module->ctx, "ietf-netconf-with-defaults");
             if (mod) {
-                lyp_print(ctx->out, " %s:default=\"true\"", xml_print_ns(ctx, mod->ns, mod->prefix, 0));
+                ly_print(ctx->out, " %s:default=\"true\"", xml_print_ns(ctx, mod->ns, mod->prefix, 0));
             }
         }
     }
@@ -177,17 +177,17 @@
                 }
 
                 for (i = 0; i < ns_count; ++i) {
-                    lyp_print(out, " xmlns:%s=\"%s\"", prefs[i], nss[i]);
+                    ly_print(out, " xmlns:%s=\"%s\"", prefs[i], nss[i]);
                 }
                 free(prefs);
                 free(nss);
             }
-            lyp_print(out, " %s=\"", meta->name);
+            ly_print(out, " %s=\"", meta->name);
         } else {
 #endif
             /* print the metadata with its namespace */
             mod = meta->annotation->module;
-            lyp_print(ctx->out, " %s:%s=\"", xml_print_ns(ctx, mod->ns, mod->prefix, 1), meta->name);
+            ly_print(ctx->out, " %s:%s=\"", xml_print_ns(ctx, mod->ns, mod->prefix, 1), meta->name);
 #if 0
         }
 #endif
@@ -196,7 +196,7 @@
         if (value && value[0]) {
             lyxml_dump_text(ctx->out, value, 1);
         }
-        lyp_print(ctx->out, "\"");
+        ly_print(ctx->out, "\"");
         if (dynamic) {
             free((void *)value);
         }
@@ -215,7 +215,7 @@
 xml_print_node_open(struct xmlpr_ctx *ctx, const struct lyd_node *node)
 {
     /* print node name */
-    lyp_print(ctx->out, "%*s<%s", INDENT, node->schema->name);
+    ly_print(ctx->out, "%*s<%s", INDENT, node->schema->name);
 
     /* print default namespace */
     xml_print_ns(ctx, node->schema->module->ns, NULL, 0);
@@ -254,7 +254,7 @@
         }
 
         /* print the attribute with its prefix and value */
-        lyp_print(ctx->out, " %s%s%s=\"%s\"", pref ? pref : "", pref ? ":" : "", attr->name, attr->value);
+        ly_print(ctx->out, " %s%s%s=\"%s\"", pref ? pref : "", pref ? ":" : "", attr->name, attr->value);
     }
 
     return LY_SUCCESS;
@@ -264,7 +264,7 @@
 xml_print_opaq_open(struct xmlpr_ctx *ctx, const struct lyd_node_opaq *node)
 {
     /* print node name */
-    lyp_print(ctx->out, "%*s<%s", INDENT, node->name);
+    ly_print(ctx->out, "%*s<%s", INDENT, node->name);
 
     /* print default namespace */
     switch (node->format) {
@@ -305,16 +305,16 @@
     /* print namespaces connected with the values's prefixes */
     for (u = 0; u < ns_list.count; ++u) {
         const struct lys_module *mod = (const struct lys_module *)ns_list.objs[u];
-        lyp_print(ctx->out, " xmlns:%s=\"%s\"", mod->prefix, mod->ns);
+        ly_print(ctx->out, " xmlns:%s=\"%s\"", mod->prefix, mod->ns);
     }
     ly_set_erase(&ns_list, NULL);
 
     if (!value || !value[0]) {
-        lyp_print(ctx->out, "/>%s", LEVEL ? "\n" : "");
+        ly_print(ctx->out, "/>%s", LEVEL ? "\n" : "");
     } else {
-        lyp_print(ctx->out, ">");
+        ly_print(ctx->out, ">");
         lyxml_dump_text(ctx->out, value, 0);
-        lyp_print(ctx->out, "</%s>%s", node->schema->name, LEVEL ? "\n" : "");
+        ly_print(ctx->out, "</%s>%s", node->schema->name, LEVEL ? "\n" : "");
     }
     if (dynamic) {
         free((void *)value);
@@ -337,12 +337,12 @@
     xml_print_node_open(ctx, (struct lyd_node *)node);
 
     if (!node->child) {
-        lyp_print(ctx->out, "/>%s", ctx->level ? "\n" : "");
+        ly_print(ctx->out, "/>%s", ctx->level ? "\n" : "");
         return LY_SUCCESS;
     }
 
     /* children */
-    lyp_print(ctx->out, ">%s", ctx->level ? "\n" : "");
+    ly_print(ctx->out, ">%s", ctx->level ? "\n" : "");
 
     LEVEL_INC;
     LY_LIST_FOR(node->child, child) {
@@ -351,7 +351,7 @@
     }
     LEVEL_DEC;
 
-    lyp_print(ctx->out, "%*s</%s>%s", INDENT, node->schema->name, LEVEL ? "\n" : "");
+    ly_print(ctx->out, "%*s</%s>%s", INDENT, node->schema->name, LEVEL ? "\n" : "");
 
     return LY_SUCCESS;
 }
@@ -369,7 +369,7 @@
     if (!any->value.tree) {
         /* no content */
 no_content:
-        lyp_print(ctx->out, "/>%s", LEVEL ? "\n" : "");
+        ly_print(ctx->out, "/>%s", LEVEL ? "\n" : "");
         return LY_SUCCESS;
     } else {
         switch (any->value_type) {
@@ -379,7 +379,7 @@
             ctx->options &= ~LYDP_WITHSIBLINGS;
             LEVEL_INC;
 
-            lyp_print(ctx->out, ">%s", LEVEL ? "\n" : "");
+            ly_print(ctx->out, ">%s", LEVEL ? "\n" : "");
             LY_LIST_FOR(any->value.tree, iter) {
                 ret = xml_print_node(ctx, iter);
                 LY_CHECK_ERR_RET(ret, LEVEL_DEC, ret);
@@ -394,7 +394,7 @@
                 goto no_content;
             }
             /* close opening tag and print data */
-            lyp_print(ctx->out, ">");
+            ly_print(ctx->out, ">");
             lyxml_dump_text(ctx->out, any->value.str, 0);
             break;
         case LYD_ANYDATA_XML:
@@ -402,7 +402,7 @@
             if (!any->value.str[0]) {
                 goto no_content;
             }
-            lyp_print(ctx->out, ">%s", any->value.str);
+            ly_print(ctx->out, ">%s", any->value.str);
             break;
         case LYD_ANYDATA_JSON:
 #if 0 /* TODO LYB format */
@@ -415,9 +415,9 @@
 
         /* closing tag */
         if (any->value_type == LYD_ANYDATA_DATATREE) {
-            lyp_print(ctx->out, "%*s</%s>%s", INDENT, node->schema->name, LEVEL ? "\n" : "");
+            ly_print(ctx->out, "%*s</%s>%s", INDENT, node->schema->name, LEVEL ? "\n" : "");
         } else {
-            lyp_print(ctx->out, "</%s>%s", node->schema->name, LEVEL ? "\n" : "");
+            ly_print(ctx->out, "</%s>%s", node->schema->name, LEVEL ? "\n" : "");
         }
     }
 
@@ -441,13 +441,13 @@
             }
         }
 
-        lyp_print(ctx->out, ">%s", node->value);
+        ly_print(ctx->out, ">%s", node->value);
     }
 
     if (node->child) {
         /* children */
         if (!node->value[0]) {
-            lyp_print(ctx->out, ">%s", ctx->level ? "\n" : "");
+            ly_print(ctx->out, ">%s", ctx->level ? "\n" : "");
         }
 
         LEVEL_INC;
@@ -457,12 +457,12 @@
         }
         LEVEL_DEC;
 
-        lyp_print(ctx->out, "%*s</%s>%s", INDENT, node->name, LEVEL ? "\n" : "");
+        ly_print(ctx->out, "%*s</%s>%s", INDENT, node->name, LEVEL ? "\n" : "");
     } else if (node->value[0]) {
-        lyp_print(ctx->out, "</%s>%s", node->name, LEVEL ? "\n" : "");
+        ly_print(ctx->out, "</%s>%s", node->name, LEVEL ? "\n" : "");
     } else {
         /* no value or children */
-        lyp_print(ctx->out, "/>%s", ctx->level ? "\n" : "");
+        ly_print(ctx->out, "/>%s", ctx->level ? "\n" : "");
     }
 
     return LY_SUCCESS;
@@ -526,14 +526,14 @@
 }
 
 LY_ERR
-xml_print_data(struct lyp_out *out, const struct lyd_node *root, int options)
+xml_print_data(struct ly_out *out, const struct lyd_node *root, int options)
 {
     const struct lyd_node *node;
     struct xmlpr_ctx ctx = {0};
 
     if (!root) {
-        if (out->type == LYP_OUT_MEMORY || out->type == LYP_OUT_CALLBACK) {
-            lyp_print(out, "");
+        if (out->type == LY_OUT_MEMORY || out->type == LY_OUT_CALLBACK) {
+            ly_print(out, "");
         }
         goto finish;
     }
