title: Spring Conditional Bean creation based on another bean
body: <p>I'm trying to find a way to only create a bean if the value of another bean/property is true, using Spring 3.2 and XML configurations.</p>
  
  <pre><code>&lt;bean id="isEnabled" class="java.lang.Boolean"&gt;
      &lt;bean factory-bean="configurationService" factory-method="getBooleanValue"&gt;
                 &lt;constructor-arg index="0"&gt;
                     &lt;util:constant static-field="org.code.ConfigurationKeys.ENABLED"/&gt;
                 &lt;/constructor-arg&gt;
      &lt;/bean&gt;
  &lt;/bean&gt;  
  
  &lt;if isEnabled=true&gt;
     ..... create some beans
  &lt;/if&gt;
  </code></pre>
  
  <p>I've seen some slightly similar examples using Spring EL but nothing that does this exactly...</p>