diff -pruN ezxml-0.8.6.orig/ezxml.c ezxml-0.8.6/ezxml.c
--- ezxml-0.8.6.orig/ezxml.c	2006-06-08 04:33:38.000000000 +0200
+++ ezxml-0.8.6/ezxml.c	2008-02-15 14:35:17.000000000 +0100
@@ -599,6 +599,19 @@ ezxml_t ezxml_parse_str(char *s, size_t 
     else return ezxml_err(root, d, "unclosed tag <%s>", root->cur->name);
 }
 
+// parse the given xml string and return an ezxml structure
+ezxml_t ezxml_parse_str_d(char const *_s, size_t len)
+{
+    ezxml_root_t root;
+    char *s;
+
+    if (! (s = strndup(_s, len))) return NULL;
+
+    root = (ezxml_root_t)ezxml_parse_str(s, strlen(s));
+    root->len = -1; // so we know to free s in ezxml_free()
+    return &root->xml;
+}
+
 // Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire
 // stream into memory and then parses it. For xml files, use ezxml_parse_file()
 // or ezxml_parse_fd()
diff -pruN ezxml-0.8.6.orig/ezxml.h ezxml-0.8.6/ezxml.h
--- ezxml-0.8.6.orig/ezxml.h	2006-06-08 03:57:30.000000000 +0200
+++ ezxml-0.8.6/ezxml.h	2008-02-15 14:37:15.000000000 +0100
@@ -59,6 +59,11 @@ struct ezxml {
 // pass in the copy. Returns NULL on failure.
 ezxml_t ezxml_parse_str(char *s, size_t len);
 
+// Given a string of xml data and its length, parses it and creates an ezxml
+// structure. that strdup()s s
+// Returns NULL on failure.
+ezxml_t ezxml_parse_str_d(char const *s, size_t len);
+
 // A wrapper for ezxml_parse_str() that accepts a file descriptor. First
 // attempts to mem map the file. Failing that, reads the file into memory.
 // Returns NULL on failure.
