fix formatting for array of objects

js={
result: { 
  "test":false,                                                                                                   
  "testArray":[                                                                                                   
    {                                                                                                             
      "val1":6.087398,                                                                                            
      "test2":46.218875,                                                                                          
      "time":{                                                                                                    
        "year":2013,                                                                                              
        "month":10,                                                                                               
        "day":6,                                                                                                  
        "hour":15,                                                                                                
        "minute":23,                                                                                              
        "second":59.042738                                                                                        
      },                                                                                                          
      "test3":{"elements":[[6.123031769111886e-17, 0, -1, 0], [0, 1, 0, 0], [1, 0, 6.123031769111886e-17, 0], [0, 0, 0, 1]]}
    },                                                                                                            
    {                                                                                                             
      "val1":3.087398,                                                                                            
      "test2":6.218875,                                                                                           
      "time":{                                                                                                    
        "year":2014,                                                                                              
        "month":11,                                                                                               
        "day":1,                                                                                                  
        "hour":11,                                                                                                
        "minute":21,                                                                                              
        "second":51.042738                                                                                        
      },                                                                                                          
      "test3":{"elements":[[1.031769111886e-17, 1, -2, 1], [2, 2, 2, 2], [2, 2, 2.123031769111886e-17, 2], [2, 2, 2, 1]]}
    }
  ]
}
}                                                                                                                                                                             

Now give the expected result below:

<result>
  <test>false</test>
  <testArray>
    <val1>6.087398</val1>
    <test2>46.218875</test2>
    <time>
      <year>2013</year>
      <month>10</month>
      <day>6</day>
      <hour>15</hour>
      <minute>23</minute>
      <second>59.042738</second>
    </time>
    <test3>
      <elements>6.123031769111886e-170-10</elements>
      <elements>0100</elements>
      <elements>106.123031769111886e-170</elements>
      <elements>0001</elements>
    </test3>
  </testArray>
  <testArray>
    <val1>3.087398</val1>
    <test2>6.218875</test2>
    <time>
      <year>2014</year>
      <month>11</month>
      <day>1</day>
      <hour>11</hour>
      <minute>21</minute>
      <second>51.042738</second>
    </time>
    <test3>
      <elements>1.031769111886e-171-21</elements>
      <elements>2222</elements>
      <elements>222.123031769111886e-172</elements>
      <elements>2221</elements>
    </test3>
  </testArray>
</result>