title: how to modify xml file using xslt
body: <p>I need to change the value of particular element of a node in a xml through xsl file Below is my xml data</p>
  
  <pre><code>&lt;hospitals&gt;
    &lt;hospital&gt;
      &lt;department&gt;
        &lt;clinic&gt;
          &lt;cid&gt;8&lt;/cid&gt;
          &lt;clinicName&gt;clinic8&lt;/clinicName&gt;
          &lt;status&gt;1&lt;/status&gt;
        &lt;/clinic&gt;
        &lt;clinic&gt;
          &lt;cid&gt;9&lt;/cid&gt;
          &lt;clinicName&gt;clinic9&lt;/clinicName&gt;
          &lt;status&gt;0&lt;/status&gt;
        &lt;/clinic&gt;
        &lt;depId&gt;3&lt;/depId&gt;
        &lt;departmentName&gt;dental&lt;/departmentName&gt;
      &lt;/department&gt;
      &lt;hospId&gt;2&lt;/hospId&gt;
      &lt;hospitalName&gt;appolo&lt;/hospitalName&gt;
    &lt;/hospital&gt;
    &lt;hospital&gt;
      &lt;department&gt;
        &lt;clinic&gt;
          &lt;cid&gt;82&lt;/cid&gt;
          &lt;clinicName&gt;clinic82&lt;/clinicName&gt;
          &lt;status&gt;0&lt;/status&gt;
        &lt;/clinic&gt;
        &lt;clinic&gt;
          &lt;cid&gt;92&lt;/cid&gt;
          &lt;clinicName&gt;clinic92&lt;/clinicName&gt;
          &lt;status&gt;0&lt;/status&gt;
        &lt;/clinic&gt;
        &lt;depId&gt;4&lt;/depId&gt;
        &lt;departmentName&gt;mental&lt;/departmentName&gt;
      &lt;/department&gt;
      &lt;hospId&gt;2&lt;/hospId&gt;
      &lt;hospitalName&gt;manipal&lt;/hospitalName&gt;
    &lt;/hospital&gt;
  &lt;/hospitals&gt;
  </code></pre>
  
  <p>for example, I need to select clinic9 based on its id ie 9 and change the status 0 to 1</p>
  
  <p>I tried like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:param name="hospId"/&gt;
  &lt;xsl:param name="depId" /&gt;
  &lt;xsl:param name="clinicId"/&gt;
  &lt;xsl:output omit-xml-declaration="yes" indent="yes"/&gt;
  &lt;xsl:strip-space elements="*"/&gt;
  &lt;xsl:template match="node()|@*"&gt;
    &lt;xsl:copy&gt;
      &lt;xsl:apply-templates select="node()|@*"/&gt;
    &lt;/xsl:copy&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match="hospitals/hospital[hospId='2']/department[depId='3']/clinic[cid='9']"&gt;
  &lt;xsl:choose&gt;
   &lt;xsl:when test="cid ='9'"&gt;
    &lt;xsl:element name="status"&gt;123&lt;/xsl:element&gt;
    &lt;/xsl:when&gt;
  &lt;/xsl:choose&gt;
  &lt;/xsl:template&gt;
    &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>But the value is not changing...</p>