title: Read attributes of element and replace part of string in the attribute based on some criteria
body: <p>I have a problem in creating the xsl transformation for below case:</p>
  
  <pre><code>&lt;text&gt;
  &lt;data&gt;
  &lt;Object class="CENTRE" Name="Country-1/CENTRE-1/RTY-1" version="1"&gt;
      &lt;p name="Map"&gt;20&lt;/p&gt;
      &lt;p name="Required"&gt;0&lt;/p&gt;
  &lt;/Object&gt;
  &lt;Object class="LEFT" Name="Country-1/LEFT-1/RTY-1" version="1"&gt;
      &lt;p name="Map"&gt;20&lt;/p&gt;
      &lt;p name="Required"&gt;0&lt;/p&gt;
  &lt;/Object&gt;
  &lt;Object class="RIGHT" Name="Country-1/RIGHT-1/UIO-1" version="1"&gt;
      &lt;p name="Map"&gt;20&lt;/p&gt;
      &lt;p name="Required"&gt;0&lt;/p&gt;
  &lt;/Object&gt;
  &lt;/data&gt;
  &lt;/text&gt;
  </code></pre>
  
  <p>In above snippet i have to:</p>
  
  <ol>
  <li>Find element for which class attribute is <strong>CENTRE</strong></li>
  <li>And Replace <strong>CENTRE</strong> with <strong>SIDE</strong> in class attribute value and sub string replace for <strong>Name</strong> attribute value from Country-1/<strong>CENTRE</strong>-1/RTY-1 to Country-1/<strong>SIDE</strong>-1/RTY-1**.</li>
  <li>Rest elements should not be affected and should be retained as it is.</li>
  </ol>
  
  <p>I tried substring replacement through a method from replace-all-string but was unsuccessful.
  Thanks in advance</p>
  
  <p>OutPut xml sholud be like:</p>
  
  <pre><code>&lt;text&gt;
  &lt;data&gt;
  &lt;Object class="SIDE" Name="Country-1/SIDE-1/RTY-1" version="1"&gt;
  &lt;p name="Map"&gt;20&lt;/p&gt;
  &lt;p name="Required"&gt;0&lt;/p&gt;
  &lt;/Object&gt;
  &lt;Object class="LEFT" Name="Country-1/LEFT-1/RTY-1" version="1"&gt;
  &lt;p name="Map"&gt;20&lt;/p&gt;
  &lt;p name="Required"&gt;0&lt;/p&gt;
  &lt;/Object&gt;
  &lt;Object class="RIGHT" Name="Country-1/RIGHT-1/UIO-1" version="1"&gt;
  &lt;p name="Map"&gt;20&lt;/p&gt;
  &lt;p name="Required"&gt;0&lt;/p&gt;
  &lt;/Object&gt;
  &lt;/data&gt;
  &lt;/text&gt;
  </code></pre>