title: How to reuse Spring XML fragments
body: <p>I am working on Spring based application. The XML is simple but contains several almost identical fragments. For example I have 5 different DAO objects, 2 queues etc. Configuration of each DAO looks like: </p>
  
  <pre><code>&lt;bean id="deviceDaoTarget" class="com.mycompany.dao.hibernate.DeviceDAOHibernateImpl"
      autowire="byName" /&gt;
  
  &lt;bean id="deviceDAO" class="org.springframework.aop.framework.ProxyFactoryBean"&gt;
      &lt;property name="proxyInterfaces"&gt;
          &lt;value&gt;com.mycompany.dao.DeviceDAO&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="interceptorNames"&gt;
          &lt;list&gt;
              &lt;value&gt;hibernateInterceptor&lt;/value&gt;
              &lt;value&gt;deviceDaoTarget&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>I'd be happy to use some kind of import with parameters. For example I'd like to create parametrized configuration of DAO like this:</p>
  
  <pre><code>&lt;bean id="${dao.target}" class="${dao.class}"
      autowire="byName" /&gt;
  
  &lt;bean id="deviceDAO" class="org.springframework.aop.framework.ProxyFactoryBean"&gt;
      &lt;property name="proxyInterfaces"&gt;
          &lt;value&gt;${dao.interface}&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="interceptorNames"&gt;
          &lt;list&gt;
              &lt;value&gt;hibernateInterceptor&lt;/value&gt;
              &lt;value&gt;${dao.target}&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and then call it several times with different parameters, e.g.:</p>
  
  <pre><code>&lt;import resource="spring-dao.xml"&gt;
      &lt;param name="dao.interface"&gt;com.mycompany.dao.hibernate.DeviceDAO&lt;/param&gt;
      &lt;param name="dao.class"&gt;com.mycompany.dao.hibernate.DeviceDAOHibernateImpl&lt;/param&gt;
      &lt;param name="dao.target"&gt;deviceDaoTarget&lt;/param&gt;
  &lt;/import&gt;
  </code></pre>
  
  <p>Is something like this possible?</p>