Index: conf/testGlobalLookup.xml
===================================================================
--- conf/testGlobalLookup.xml	(revision 0)
+++ conf/testGlobalLookup.xml	(revision 0)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!-- Test configuration definition file that demonstrates complex initialization -->
+<configuration>
+  <header>
+    <result delimiterParsingDisabled="true">
+      <nodeCombiner config-class="org.apache.commons.configuration.tree.OverrideCombiner"/>
+      <expressionEngine config-class="org.apache.commons.configuration.tree.xpath.XPathExpressionEngine"/>
+    </result>
+    <lookups>
+      <lookup config-prefix="test"
+              config-class="org.apache.commons.configuration.TestDefaultConfigurationBuilder$TestLookup"/>
+    </lookups>
+    <combiner>
+      <override>
+        <list-nodes>
+          <node>table</node>
+          <node>list</node>
+        </list-nodes>
+      </override>
+    </combiner>
+  </header>
+  <system/>
+  <properties fileName="test.properties" throwExceptionOnMissing="true"
+    config-name="properties">
+    <reloadingStrategy config-class="org.apache.commons.configuration.reloading.FileChangedReloadingStrategy"
+      refreshDelay="10000"/>
+  </properties>
+  <!-- Fetch the file name from a variable -->
+  <xml fileName="${test:test_file_xml}" config-name="xml">
+    <expressionEngine config-class="org.apache.commons.configuration.tree.DefaultExpressionEngine"
+      propertyDelimiter="/" indexStart="[" indexEnd="]"/>
+  </xml>
+  <additional>
+    <xml config-name="combiner1" fileName="${test:test_file_combine}"/>  -->
+    <xml config-name="combiner2" fileName="testcombine2.xml"/>
+  </additional>
+</configuration>
\ No newline at end of file
Index: src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java
===================================================================
--- src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java	(revision 714217)
+++ src/test/org/apache/commons/configuration/TestDefaultConfigurationBuilder.java	(working copy)
@@ -20,6 +20,8 @@
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
 
 import junit.framework.TestCase;
 
@@ -27,6 +29,8 @@
 import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
 import org.apache.commons.configuration.tree.DefaultConfigurationNode;
 import org.apache.commons.configuration.tree.xpath.XPathExpressionEngine;
+import org.apache.commons.configuration.interpol.ConfigurationInterpolator;
+import org.apache.commons.lang.text.StrLookup;
 
 /**
  * Test class for DefaultConfigurationBuilder.
@@ -64,6 +68,9 @@
     private static final File EXTENDED_PROVIDER_FILE = new File(
             "conf/testExtendedXMLConfigurationProvider.xml");
 
+    private static final File GLOBAL_LOOKUP_FILE = new File(
+            "conf/testGlobalLookup.xml");
+
     /** Constant for the name of an optional configuration.*/
     private static final String OPTIONAL_NAME = "optionalConfig";
 
@@ -794,6 +801,16 @@
                 config.getClass().getName(), config instanceof ExtendedXMLConfiguration);
     }
 
+    public void testGlobalLookup() throws Exception
+    {
+        factory.setFile(GLOBAL_LOOKUP_FILE);
+        CombinedConfiguration cc = factory.getConfiguration(true);
+        String value = cc.getInterpolator().lookup("test:test_key");
+        assertNotNull("The test key was not located", value);
+        assertEquals("Incorrect value retrieved","test.value",value);       
+    }
+
+
     /**
      * A specialized combined configuration implementation used for testing
      * custom result classes.
@@ -823,5 +840,27 @@
         }
 
     }
+
+    public static class TestLookup extends StrLookup
+    {
+        Map map = new HashMap();
+
+        public TestLookup()
+        {
+            map.put("test_file_xml", "test.xml");
+            map.put("test_file_combine", "testcombine1.xml");
+            map.put("test_key", "test.value");
+        }
+
+        public String lookup(String key)
+        {
+            if (key == null)
+            {
+                return null;
+            }
+            return (String)map.get(key);
+
+        }
+    }
 }
 
Index: src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java
===================================================================
--- src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java	(revision 714217)
+++ src/java/org/apache/commons/configuration/DefaultConfigurationBuilder.java	(working copy)
@@ -34,7 +34,9 @@
 import org.apache.commons.configuration.tree.DefaultExpressionEngine;
 import org.apache.commons.configuration.tree.OverrideCombiner;
 import org.apache.commons.configuration.tree.UnionCombiner;
+import org.apache.commons.configuration.interpol.ConfigurationInterpolator;
 import org.apache.commons.logging.LogFactory;
+import org.apache.commons.lang.text.StrLookup;
 
 /**
  * <p>
@@ -160,6 +162,15 @@
  * </pre>
  * </p>
  * <p>
+ * Additional variable resolvers can be added by configuring them in the <em>header</em>
+ * section.
+ * <pre>
+ * &lt;lookups&gt;
+ *   &lt;lookup config-prefix="prefix" config-class="StrLookup fully qualified class name"/&gt;
+ * &lt;/lookups&gt;
+ * </pre>
+ * </p>
+ * <p>
  * All declared override configurations are directly added to the resulting
  * combined configuration. If they are given names (using the
  * <code>config-name</code> attribute), they can directly be accessed using
@@ -291,6 +302,17 @@
     static final String KEY_PROVIDER_KEY = XMLBeanDeclaration.ATTR_PREFIX + "tag]";
 
     /**
+     * Constant for the key for defining variable resolvers
+     */
+    static final String KEY_CONFIGURATION_LOOKUPS = SEC_HEADER
+            + ".lookups.lookup";
+
+    /**
+     * Constant for the prefix attribute for lookups.
+     */
+    static final String KEY_LOOKUP_KEY = XMLBeanDeclaration.ATTR_PREFIX + "prefix]";
+
+    /**
      * Constant for the key of the result declaration. This key can point to a
      * bean declaration, which defines properties of the resulting combined
      * configuration.
@@ -516,6 +538,7 @@
         }
 
         registerConfiguredProviders();
+        registerConfiguredLookups();
 
         CombinedConfiguration result = createResultConfiguration();
         constructedConfiguration = result;
@@ -631,6 +654,23 @@
     }
 
     /**
+     * Registers StrLookups defined in the configuration.
+     *
+     * @throws ConfigurationException if an error occurs
+     */
+    protected void registerConfiguredLookups() throws ConfigurationException
+    {
+        List nodes = configurationsAt(KEY_CONFIGURATION_LOOKUPS);
+        for (Iterator it = nodes.iterator(); it.hasNext();)
+        {
+            HierarchicalConfiguration config = (HierarchicalConfiguration) it.next();
+            XMLBeanDeclaration decl = new XMLBeanDeclaration(config);
+            String key = config.getString(KEY_LOOKUP_KEY);
+            ConfigurationInterpolator.registerGlobalLookup(key, (StrLookup)BeanHelper.createBean(decl));
+        }
+    }
+
+    /**
      * Performs interpolation. This method will not only take this configuration
      * instance into account (which is the one that loaded the configuration
      * definition file), but also the so far constructed combined configuration.
