This question already has an answer here:
The following (in quote) is the content of a XML file which is part of my package.
I'd like to replace the value of c:\path\myapp.exe
during the installation (with the real path where the user chose to install the application.
Is that possible? How to?
<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
</listAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="c:\path\myapp.exe"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="${resource_loc}"/>
</launchConfiguration>
Your best option is to use the XML DOM to select and edit the required node as TLama suggested.
Alternatively, you can install a template file with a known string in the location you want to replace. The file can then be read as a string, modified and written back out again using something like:
See also this question about doing the same thing en masse to an INI file.