printer FEATURE print data into memory
diff --git a/src/xml.c b/src/xml.c
index a3c2354..c667be2 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -1363,6 +1363,27 @@
 }
 
 API int
+lyxml_dump_mem(char **strp, struct lyxml_elem *elem, int options)
+{
+    struct lyout out;
+    int r;
+
+    if (!strp || !elem) {
+        return 0;
+    }
+
+    out.type = LYOUT_MEMORY;
+    out.method.mem.buf = NULL;
+    out.method.mem.len = 0;
+    out.method.mem.size = 0;
+
+    r = dump_elem(&out, elem, 0, options);
+
+    *strp = out.method.mem.buf;
+    return r;
+}
+
+API int
 lyxml_dump_clb(ssize_t (*writeclb)(void *arg, const void *buf, size_t count), void *arg, struct lyxml_elem *elem, int options)
 {
     struct lyout out;