diff --git a/modules/filters/mod_xml2enc.c b/modules/filters/mod_xml2enc.c
index 13608ed..452c264 100644
--- a/modules/filters/mod_xml2enc.c
+++ b/modules/filters/mod_xml2enc.c
@@ -74,12 +74,18 @@ typedef struct {
     const char* default_charset;
     xmlCharEncoding default_encoding;
     apr_array_header_t* skipto;
+    apr_array_header_t* ctypes;
+    int ctypes_set;
 } xml2cfg;
 
 typedef struct {
     const char* val;
 } tattr;
 
+typedef struct {
+    const char *val;
+} tctype;
+
 static ap_regex_t* seek_meta_ctype;
 static ap_regex_t* seek_charset;
 
@@ -306,12 +312,14 @@ static apr_status_t xml2enc_filter_init(ap_filter_t* f)
 static apr_status_t xml2enc_ffunc(ap_filter_t* f, apr_bucket_brigade* bb)
 {
     xml2ctx* ctx = f->ctx;
+    xml2cfg* cfg = ap_get_module_config(f->r->per_dir_config, &xml2enc_module);
     apr_status_t rv;
     apr_bucket* b;
     apr_bucket* bstart;
     apr_size_t insz = 0;
     char *ctype;
     char *p;
+    int i;
 
     if (!ctx || !f->r->content_type) {
         /* log error about configuring this */
@@ -330,10 +338,19 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, apr_bucket_brigade* bb)
         if (isupper(*p))
             *p = tolower(*p);
 
-    /* only act if starts-with "text/" or contains "xml" */
-    if (strncmp(ctype, "text/", 5) && !strstr(ctype, "xml"))  {
-        ap_remove_output_filter(f);
-        return ap_pass_brigade(f->next, bb) ;
+    /* only act if we were configured to handle this content type */
+    rv = APR_EGENERAL;
+    tctype *ctypes = (tctype*) cfg->ctypes->elts;
+    for (i=0; i < cfg->ctypes->nelts; ++i) {
+        if (!strncmp(ctype, ctypes[i].val, strlen(ctypes[i].val))) {
+            rv = APR_SUCCESS;
+            break;
+        }
+    }
+    if (rv != APR_SUCCESS) {
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r, "not configured to handle this content type (%s), removing filter", ctype);
+        ap_remove_output_filter(f) ;
+        return ap_pass_brigade(f->next, bb);
     }
 
     if (ctx->bbsave == NULL) {
@@ -656,6 +673,22 @@ static const char* set_skipto(cmd_parms* cmd, void* CFG, const char* arg)
     return NULL;
 }
 
+static const char *set_content_type(cmd_parms *cmd, void *CFG, const char *arg)
+{
+    tctype *ctype;
+    xml2cfg *cfg = CFG;
+
+    if (cfg->ctypes == NULL)
+        cfg->ctypes = apr_array_make(cmd->pool, 8, sizeof(tctype));
+    else if (cfg->ctypes_set == 0)
+        apr_array_clear(cfg->ctypes);
+
+    ctype = apr_array_push(cfg->ctypes);
+    ctype->val = arg;
+    cfg->ctypes_set = 1;
+    return NULL;
+}
+
 static const command_rec xml2enc_cmds[] = {
     AP_INIT_TAKE1("xml2EncDefault", set_default, NULL, OR_ALL,
                   "Usage: xml2EncDefault charset"),
@@ -663,12 +696,19 @@ static const command_rec xml2enc_cmds[] = {
                      "EncodingAlias charset alias [more aliases]"),
     AP_INIT_ITERATE("xml2StartParse", set_skipto, NULL, OR_ALL,
                     "Ignore anything in front of the first of these elements"),
+    AP_INIT_TAKE1("xml2AcceptContentType", set_content_type, NULL,
+                  RSRC_CONF|ACCESS_CONF, "Add parsable content type"),
     { NULL }
 };
 static void* xml2enc_config(apr_pool_t* pool, char* x)
 {
     xml2cfg* ret = apr_pcalloc(pool, sizeof(xml2cfg));
     ret->default_encoding = XML_CHAR_ENCODING_NONE ;
+    ret->ctypes = apr_array_make(pool, 8, sizeof(tctype));
+    tctype* ctype = apr_array_push(ret->ctypes);
+    ctype->val = apr_pstrndup(pool, "text/html", 9);
+    ctype = apr_array_push(ret->ctypes);
+    ctype->val = apr_pstrndup(pool, "application/xhtml+xml", 21);
     return ret;
 }
 
@@ -682,6 +722,8 @@ static void* xml2enc_merge(apr_pool_t* pool, void* BASE, void* ADD)
     ret->default_charset = add->default_charset
                          ? add->default_charset : base->default_charset;
     ret->skipto = add->skipto ? add->skipto : base->skipto;
+    ret->ctypes = add->ctypes_set ? add->ctypes : base->ctypes;
+    ret->ctypes_set = add->ctypes_set ? add->ctypes_set : base->ctypes;
     return ret;
 }
 
