title: JsonToXML Array within Array with Different Parent Names in Apigee
body: <p>I am trying to build an XML structure for a WSDL call, since there isn't a real proper way to send an arbitary size list of complex objects using the parameter passing method, I decided to use Json to XML. Here is my basic Json</p>
  
  <pre><code>school:{
    teachers : [
      {students :[{name: student1}, {name: student2}], name : teacher1},
      {students :[{name: student3}, {name: student4}], name : teacher2}
    ]
  }
  </code></pre>
  
  <p>and what I want to see as an end result is</p>
  
  <pre><code>&lt;school&gt;
    &lt;teachers&gt;
      &lt;name&gt;teacher1&lt;/name&gt;
      &lt;students&gt;
        &lt;name&gt;student1&lt;/name&gt;
        &lt;name&gt;student2&lt;/name&gt;
      &lt;/students&gt;
    &lt;/teachers&gt;
    &lt;teachers&gt;
      &lt;name&gt;teacher1&lt;/name&gt;
      &lt;students&gt;
        &lt;name&gt;student1&lt;/name&gt;
        &lt;name&gt;student2&lt;/name&gt;
      &lt;/students&gt;
    &lt;/teachers&gt;
  &lt;/school&gt;
  </code></pre>
  
  <p>Using what Apigee Documentation</p>
  
  <pre><code>&lt;ArrayRootElementName&gt;Teachers&lt;/ArrayRootElementName&gt;
  </code></pre>
  
  <p>It still would handle the Students properly, in fact it changes my Students to Teachers. Can someone help please.</p>