Given the file web.config:
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<settings001>
<common>
</common>
</settings001>
</configuration>
try adding an element using
<util:xmlfile id="user-content-XmlConfigTes" action="createElement" elementpath="/configuration/settings001/common" name="option001" value="value001" file="<span>[#file001]</span>" selectionlanguage="XPath"></util:xmlfile>
Then ExecXmlFile reports an error:
"MSI (s) (90!08) [19:51:11:654]: Product: _MyProduct01 -- Error 25532. Failed to find node: /configuration/settings001/common in XML file: C:\Programme_MyProduct01\web.config, system error: -2147020584"
The error disappears if the namespace declaration in web.config is removed.
Sample to reproduce the error
XML file to be modified
This is by correct design of the XPath specification. None of the elements "configuration", "settings001", or "common" are in the empty namespace, much less the combination in the order you requested. Navigating this XML file using XPath requires configuring the namespace manager, but that configuration is not exposed via the current implementation of this extension element.
What is needed is to add namespace support to the XmlFile (and XmlConfig) elements so that they can access these types of xml items.
For those faced with the same problem, using XmlConfig worked for me:
<util:xmlconfig id="user-content-XmlConfigTes" file="<span>[#file001]</span>" action="create" elementpath="/configuration/settings001/common" name="option001" node="element" value="value001" on="install"></util:xmlconfig>
XmlConfig resolves the ElementPath although strictly speaking it refers to elements in the empty namespace, not the default namespace. Apparently some extra support for files with a default namespace was added to XmlConfig, see tracker ID 2477689.