title: How to change a value in XML programmatically
body: <p>I have a spring batch application. The database that is used to store meta-data of spring batch job is configured like the following:</p>
  
  <p><strong>In application-context.xml:</strong></p>
  
  <pre><code>&lt;!-- stored job-meta in database - H2 --&gt;
      &lt;bean id="jobRepository"
          class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSourceMetaData" /&gt;
          &lt;property name="transactionManager" ref="transactionManager" /&gt;
          &lt;property name="databaseType" value="h2" /&gt;    
      &lt;/bean&gt;
  </code></pre>
  
  <p><strong>In database.xml:</strong></p>
  
  <pre><code>&lt;!-- configure H2 database connection --&gt;
  &lt;bean id="dataSourceMetaData"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
      &lt;property name="driverClassName" value="org.h2.Driver" /&gt;
      &lt;property name="url" value="jdbc:h2:~/metaDataProd" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Now the application can run in the same environment in multiple instance for ex: one instance for prod &amp; one instance for test. So I have to make the <code>value="jdbc:h2:~/metaDataProd</code> configurable so that both instance does not access the same db. </p>
  
  <p>I can easily do that if I generate the value from a config file. But I am wondering if there is any automatic way of doing this. For example: When an application instance is initiated then a datevalue is appended programmatic ally like this <code>value="jdbc:h2:~/metaData2Jul</code> <code>value="jdbc:h2:~/metaData4Jul</code></p>