Index: modules/filters/mod_xml2enc.c
===================================================================
--- modules/filters/mod_xml2enc.c	(revision 1564776)
+++ modules/filters/mod_xml2enc.c	(working copy)
@@ -71,6 +71,7 @@
     const char* default_charset;
     xmlCharEncoding default_encoding;
     apr_array_header_t* skipto;
+    apr_array_header_t* types;
 } xml2cfg;
 
 typedef struct {
@@ -307,6 +308,7 @@
     apr_size_t insz = 0;
     char *ctype;
     char *p;
+    int wanted = 0;
 
     if (!ctx || !f->r->content_type) {
         /* log error about configuring this */
@@ -315,14 +317,26 @@
     }
 
     ctype = apr_pstrdup(f->r->pool, f->r->content_type);
-    for (p = ctype; *p; ++p)
-        if (isupper(*p))
-            *p = tolower(*p);
+    ap_str_tolower(ctype);
 
-    /* only act if starts-with "text/" or contains "xml" */
-    if (strncmp(ctype, "text/", 5) && !strstr(ctype, "xml"))  {
+    if (cfg->types != NULL) {
+        /* sysop has specified list of content types to act upon */
+        int i;
+        tattr *types = cfg->types->elts;
+        for (i = 0; i < cfg->types->nelts; ++i) {
+            if (!strncmp(ctype, types[i].val, strlen(types[i].val))) {
+                wanted = 1;
+                break;
+            }
+        }
+    }
+    else {
+        /* default - only act if starts-with "text/" or contains "xml" */
+        wanted = !strncmp(ctype, "text/", 5) || strstr(ctype, "xml");
+    }
+    if (!wanted) {
         ap_remove_output_filter(f);
-        return ap_pass_brigade(f->next, bb) ;
+        return ap_pass_brigade(f->next, bb);
     }
 
     if (ctx->bbsave == NULL) {
@@ -579,16 +593,29 @@
         return NULL;
     }
 }
-static const char* set_skipto(cmd_parms* cmd, void* CFG, const char* arg)
+static const char *set_skipto(cmd_parms *cmd, void *CFG, const char *arg)
 {
-    tattr* attr;
-    xml2cfg* cfg = CFG;
+    tattr *attr;
+    xml2cfg *cfg = CFG;
     if (cfg->skipto == NULL)
         cfg->skipto = apr_array_make(cmd->pool, 4, sizeof(tattr));
     attr = apr_array_push(cfg->skipto) ;
     attr->val = arg;
     return NULL;
 }
+static const char *set_types(cmd_parms *cmd, void *CFG, const char *arg)
+{
+    tattr *attr;
+    char *t;
+    xml2cfg *cfg = CFG;
+    if (cfg->types == NULL)
+        cfg->types = apr_array_make(cmd->pool, 4, sizeof(tattr));
+    attr = apr_array_push(cfg->types) ;
+    t = apr_pstrdup(cmd->pool, arg);
+    ap_str_tolower(t);
+    attr->val = t;
+    return NULL;
+}
 
 static const command_rec xml2enc_cmds[] = {
     AP_INIT_TAKE1("xml2EncDefault", set_default, NULL, OR_ALL,
@@ -597,6 +624,8 @@
                      "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_ITERATE("xml2Types", set_types, NULL, OR_ALL,
+                    "Content Types to process (default: any type starting with 'text/' or containing 'xml')"),
     { NULL }
 };
 static void* xml2enc_config(apr_pool_t* pool, char* x)
@@ -616,6 +645,7 @@
     ret->default_charset = add->default_charset
                          ? add->default_charset : base->default_charset;
     ret->skipto = add->skipto ? add->skipto : base->skipto;
+    ret->types = add->types ? add->types : base->types;
     return ret;
 }
 
