title: Editing XML using a php script
body: <p>I have a problem, I need to edit an xml file using php, based on a string variable it has been passed.</p>
  
  <p>i.e., my php has a string variable which takes the value of either "true" or "false" and I need to alter the following xml file code:</p>
  
  <pre><code>&lt;Parameter&gt;             
       &lt;ParameterName&gt;Method1&lt;/ParameterName&gt;                  
       &lt;ParameterDescription&gt;description&lt;/ParameterDescription&gt;
       &lt;ParameterValue type="bool"&gt;false&lt;/ParameterValue&gt;
  &lt;/Parameter&gt;
  
  &lt;Parameter&gt; 
       &lt;ParameterName&gt;Method2&lt;/ParameterName&gt;       
       &lt;ParameterDescription&gt;description&lt;/ParameterDescription&gt; 
       &lt;ParameterValue type="bool"&gt;true&lt;/ParameterValue&gt;
  &lt;/Parameter&gt; 
  
  &lt;Parameter&gt;
       &lt;ParameterName&gt;Method3&lt;/ParameterName&gt;
       &lt;ParameterDescription&gt;description&lt;/ParameterDescription&gt;
       &lt;ParameterValue type="float"&gt;0.025&lt;/ParameterValue&gt; 
  &lt;/Parameter&gt;
  </code></pre>
  
  <p>So that the first "ParameterValue" changes from it's default "false" to whatever the value of the variable is (note that the variable in the php is a string, and in the xml is a boolean type). I have looked at suggestions involving awk, and sen and dom without much luck. I am hoping for the simplest way to change this one word in the XML!</p>
  
  <p>James</p>