title: How can I insert the greater- and less-than characters into an XML file modified by WiX during install?
body: <p>I'm using WiX to author a Windows Installation database for my application. I've got an XML file that is installed along with my app, which needs to be filled with information obtained during installation. The WiXUtilExtension tags <a href="http://wix.sourceforge.net/manual-wix3/util_xsd_xmlfile.htm" rel="nofollow noreferrer">util:XmlFile</a> and <a href="http://wix.sourceforge.net/manual-wix3/util_xsd_xmlconfig.htm" rel="nofollow noreferrer">util:XmlConfig</a> are great ways to do this, in principle, but they don't quite solve my problem. Specifically, I need to insert some javascript:</p>
  
  <pre><code>&lt;?js
      //some javascript that must include formatted string properties
      //so that [PropertyName] evaluates to its value during installation
  ?&gt;
  </code></pre>
  
  <p>but with that text as the value of the util:XmlFile/@Value attribute, it won't compile (no surprise - error CNDL0104). And neither backslash nor [\ ] (escape sequence for square bracket) seem to escape the greater-than or less-than characters.</p>
  
  <p>I also tried placing the inserted text into the inner text of the util:XmlConfig element, but with the Javascript tag present, it just ignores the text. Wrapping the inner text in CDATA tags inserts the text, but replaces the greater- and less-than characters with their entities "&amp; gt;" and "&amp; lt;", without the quotes and spaces.</p>
  
  <p>What's the trick?</p>
  
  <p>EDIT: Still struggling with this problem, but some more details might help clarify further. Here's an example of an XML file with the structure I need to modify on install.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;RootElement&gt;
      &lt;SubElement&gt;
          &lt;?js
              //insert Javascript here with formatted property values e.g. [PropertyName]
          ?&gt;
      &lt;/SubElement&gt;
  &lt;/RootElement&gt;
  </code></pre>
  
  <p>In my WiX code, I had:</p>
  
  <pre><code>&lt;util:XmlConfig Id="EditXml" File="foo.xml" Action="create" Node="value" On="install" ElementPath="//RootElement/SubElement" Sequence="1" &gt;
      &lt;![CDATA[//the Javascript code]]&gt;
  &lt;/util:XmlConfig&gt;
  </code></pre>
  
  <p>which, of course, placed the text next to the Javascript processing instruction, rather than within it. So I looked into accessing XML processing instruction tags with <a href="http://www.w3.org/TR/xpath/" rel="nofollow noreferrer">XPath</a>, thinking that perhaps I wasn't using the correct value for the util:XmlConfig/@ElementPath attribute. I've never used XPath before, but I thought one of the following changes would work:</p>
  
  <pre><code>ElementPath="//RootElement/SubElement/processing-instruction('js')"
  ElementPath="processing-instruction('js')//RootElement/SubElement"
  ElementPath="//processing-instruction('js')"
  ElementPath="processing-instruction('js')"
  </code></pre>
  
  <p>but to no avail. Am I just off with this syntax, or is there another solution altogether?</p>
  
  <p>Thanks in advance for the help!</p>