title: Add and Replace placeholder in XML from property files
body: <p>I am developing a web application which will be deployed in different environments like Dev, Test and Production. Some of the configurations will be specific to environments and so I need to change the configurations in the property files with respect to the environments where the project is deployed. </p>
  
  <p>I added the Environment variable in machine and obtained it using the method </p>
  
  <blockquote>
    <p>System.getEnv("Environment")</p>
  </blockquote>
  
  <p>which would return the value like, dev, test and prod and I load the respective property files (File names are dev-config.properties, test-config.properties).</p>
  
  <p>I am implementing the PicketLink libraries in jBoss AS to integrate the application with SSO-SAML. One of the configurations is to add a file named picketlink-idfed.xml, where I mention the IDP URL and application url. Both the URLs will be different for environments. I cannot have different file names like dev-picketlink-idfed.xml and so I cannot follow the above approach of using different files.</p>
  
  <p>Question is that I need to use the same file picketlink-idfed.xml, just by adding the placeholder and replace it with the respective values from the property files. Attached the sample content of picketlink-idfed.xml.</p>
  
  <pre><code>&lt;IdentityURL&gt;https://idfed.test.com.au/adfs/ls/idpinitiatedsignon.aspx?LoginToRP=https%3A%2F%2Fapp.test.com.au%2Fdisplays%2FHome.action
  &lt;/IdentityURL&gt;
  &lt;ServiceURL&gt;https://app.test.com.au/displays/Home.action
  &lt;/ServiceURL&gt;
  </code></pre>
  
  <p>In the above line the values for tags <strong>IdentityURL</strong> and <strong>ServiceURL</strong> will be changed for different environments. Can you please tell me on how to address this issue?</p>
  
  <p>Note: For time being, I am replacing the contents for every deployment, which is not good practice. Also, I am not using Maven or Ant build files. I cannot use these due to insufficient time.</p>