When you create an msi installer with WiX, you may need to modify app.config according to user settings and/or properties. You can simply do it by using <XmlFile /> custom action tag. It can be used as follows:
<XmlFile Id="ModifyServerLocation" Action="setValue" ElementPath="/configuration/appSettings/add[\[]@key='ServiceLocation'[\]]/@value" File="[TARGETDIR]\myApp.config" Value="[SERVERLOCATION]"/>
Note that [@key='ServiceLocation] must be encoded in [ ] bracket, otherwise, MSI will treat it as property before putting the value.