title: How to set element value to xml attribute in esql outputroot
body: <p>I'm trying to create a xml file, using a compute node.
  My requirement is to generate the following xml document</p>
  
  <pre><code>   &lt;soapenv:Envelope&gt;
        &lt;soapenv:Body&gt;
           &lt;man:request domain="My-Dom"&gt;
              &lt;man:b2b-query-metadata&gt;
                 &lt;man:query&gt;
                    &lt;man:query-condition evaluation="property-greater-than"&gt;
                       &lt;man:property-name&gt;InputTime&lt;/man:property-name&gt;
                       &lt;man:value&gt;2018-08-10 00:00:00&lt;/man:value&gt;
                    &lt;/man:query-condition&gt;
                 &lt;/man:query&gt;
                 &lt;man:result-constraints&gt;
                    &lt;man:sort-order&gt;
                       &lt;man:property-name direction="asc"&gt;InputTime&lt;/man:property-name&gt;
                    &lt;/man:sort-order&gt;
                 &lt;/man:result-constraints&gt;
              &lt;/man:b2b-query-metadata&gt;
           &lt;/man:request&gt;
        &lt;/soapenv:Body&gt;
     &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>Following is the snippet that is used to generate the required xml document.</p>
  
  <pre><code>CREATE COMPUTE MODULE FLOW_Compute
  
         CREATE FUNCTION Main() RETURNS BOOLEAN
  
         BEGIN
                CALL CopyMessageHeaders();
                CALL CreateSOAPReq();
                RETURN TRUE;
         END;
  
         CREATE PROCEDURE CopyMessageHeaders() BEGIN
  
                DECLARE I INTEGER 1;
                DECLARE J INTEGER;
                SET J = CARDINALITY(InputRoot.*[]);
  
                WHILE I &lt; J DO
                       SET OutputRoot.*[I] = InputRoot.*[I];
                       SET I = I + 1;
                END WHILE;
  
         END;
  
                CREATE PROCEDURE CreateSOAPReq() BEGIN       
  
                DECLARE soapenv NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
                DECLARE man NAMESPACE 'http://www.datapower.com/schemas/management';   
  
                SET OutputRoot.HTTPRequestHeader.POST = 'https://my.testbox.com:5550/service/mgmt/3.0'; 
                SET OutputRoot.HTTPRequestHeader."Content-Type" = 'text/xml;charset=UTF-8';
                SET OutputRoot.HTTPRequestHeader."Authorization" = 'Basic '||base64Encode(CAST('myuserid:mypassword' as BLOB CCSID InputRoot.Properties.CodedCharSetId));
                SET OutputRoot.HTTPRequestHeader.Host = 'my.testbox.com:5550';
  
                SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.man:request.(XMLNSC.Attribute)man:domain = 'My-Dom';
                SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.man:request.man:"b2b-query-metadata".man:query.man:"query-condition".evaluation = 'property-greater-than';
                SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.man:request.man:"b2b-query-metadata".man:query.man:"query-condition".man:"property-name" = 'InputTime';
                SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.man:request.man:"b2b-query-metadata".man:query.man:"query-condition".man:value = '2018-08-10 00:00:00';  
                --SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.man:request.man:"b2b-query-metadata".man:"result-constraints".man:"sort-order".man:"property-name".(XMLNSC.Attribute)man:direction = 'asc';          
         END;
  
  END MODULE;
  </code></pre>
  
  <hr>
  
  <p>Update:
  after successfully clearing the hurdle where in i was able to obtain the following xml element: <code>&lt;man:request domain="My-Dom"&gt;</code> using the following statement <code>SET OutputRoot.XMLNSC.soapenv:Envelope.soapenv:Body.man:request.(XMLNSC.Attribute)man:domain = 'B2B-Dev';</code> , I am struck at this part: <code>&lt;man:property-name direction="asc"&gt;InputTime&lt;/man:property-name&gt;</code></p>
  
  <p>I tried to scan for examples wherein we create <code>outputroot</code> from scratch, however most of the examples deal with parsing through inbound content:
  <a href="https://www.ibm.com/support/knowledgecenter/en/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ac67241_.htm" rel="nofollow noreferrer">https://www.ibm.com/support/knowledgecenter/en/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ac67241_.htm</a></p>
  
  <p>I understand that we are having attributes, which need to be assigned element value. I'm not sure on how to proceed on this bit. Can someone point me to an example which involves a the <code>SET</code> command in esql. </p>
  
  <p>Any suggestion is welcome.</p>