title: Set Attribute with ESQL in XMLNSC for XML Array
body: <p>I am succeeding in adding a <code>name="xxxxxx"</code> attribute to an XML element when there is one, but not for an array of repeated elements.</p>
  
  <p>For instance, I can create a <code>&lt;Broker name="xxxxxx"</code>> element with the following line:</p>
  
  <pre><code>SET OutputRoot.XMLNSC.SystemDetails.BrokerDetails.Broker.(XMLNSC.Attribute)name = 
  FIELDVALUE(InputRoot.XMLNSC.broker.(XMLNSC.Attribute)name);
  </code></pre>
  
  <p>And can create an array of XML Elements with the following line:</p>
  
  <pre><code>SET OutputRoot.XMLNSC.SystemDetails.BrokerDetails.Servers.Server[] = 
      SELECT ITEM FIELDVALUE(A.(XMLNSC.Attribute)name)
      FROM InputRoot.XMLNSC.broker.executionGroups.executionGroup[] AS A;
  </code></pre>
  
  <p>Which gives:</p>
  
  <pre><code>&lt;SystemDetails&gt;
       &lt;BrokerDetails&gt;
             &lt;Broker name="xxxxxx" /&gt;
             &lt;Servers&gt;
                  &lt;Server&gt;xxx1&lt;/Server&gt;
                  &lt;Server&gt;xxx2&lt;/Server&gt;
                  &lt;Server&gt;xxx3&lt;/Server&gt;
                  &lt;Server&gt;xxx4&lt;/Server&gt;
             &lt;/Servers&gt;
       &lt;/BrokerDetails&gt;
  &lt;/SystemDetails&gt;
  </code></pre>
  
  <p>But cannot combine the two methods to create what I want which is the following:</p>
  
  <pre><code>&lt;SystemDetails&gt;
       &lt;BrokerDetails&gt;
             &lt;Broker name="xxxxxx" /&gt;
             &lt;Servers&gt;
                  &lt;Server name="xxx1" /&gt;
                  &lt;Server name="xxx2" /&gt;
                  &lt;Server name="xxx3" /&gt;
                  &lt;Server name="xxx4" /&gt;
             &lt;/Servers&gt;
       &lt;/BrokerDetails&gt;
  &lt;/SystemDetails&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated.</p>