Java tutorial
//package com.java2s; import java.util.Map; public class Main { public static String assignDynamicValues(String inputXML, Map<String, String> dynamicValues) { for (String key : dynamicValues.keySet()) { if (inputXML.contains("{" + key + "}")) { inputXML = inputXML.replaceAll("\\{" + key + "\\}", dynamicValues.get(key)); } } return inputXML; } }