title: Websphere Message Broker: Accessing XML elements in ESQL
body: <p>Websphere Message Broker: File in File out example. 
  I have an XML file with repeating element structure. How can I access and modify value of a particular element in ESQL.
  I worte following code..</p>
  
  <pre><code>CREATE PROCEDURE CopyEntireMessage() BEGIN
       --SET OutputRoot = InputRoot;
        DECLARE I INTEGER 1;
        DECLARE J INTEGER;
        SET J = CARDINALITY(OutputRoot.*[]);
        WHILE I &lt; J DO
           SET OutputRoot = InputRoot;
           SET OutputRoot.XMLNS.person.student[I].name = 'XYZ';
           SET I = I + 1;
        END WHILE;
   END;
  </code></pre>
  
  <p>But its not working. Picking up the file from input folder but i cannot see anything in Output folder.
  But if I comment </p>
  
  <pre><code>SET OutputRoot.XMLNS.student[I].name = 'XYZ';
  </code></pre>
  
  <p>then file is available in output folder as it is without any change. </p>
  
  <p>My XML file is as below</p>
  
  <pre><code>&lt;person&gt;
   &lt;student&gt;
     &lt;name&gt;ABC&lt;/name&gt;
     &lt;age&gt;20&lt;/age&gt;
     &lt;address&gt;city1&lt;/address&gt;
   &lt;/student&gt;
   &lt;student&gt;
     &lt;name&gt;PQR&lt;/name&gt;
     &lt;age&gt;20&lt;/age&gt;
     &lt;address&gt;city2&lt;/address&gt;
   &lt;/student&gt;
  &lt;/person&gt;
  </code></pre>
  
  <p>can anybody help me on this?</p>