title: Transforming from json to xml in mule dataweave is not working
body: <p>If I send following JSON it works</p>
  
  <pre><code>{
    "abc":{
      "ccc":"ddd",
      "eee":"fff",
      "ggg":"aaa"
    }
  }
  </code></pre>
  
  <p>it gives response like following that is what I want</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='windows-1252'?&gt;
  &lt;abc&gt;
  &lt;ccc&gt;ddd&lt;/ccc&gt;
  &lt;eee&gt;fff&lt;/eee&gt;
  &lt;ggg&gt;aaaa&lt;/ggg&gt;
  &lt;/abc&gt;
  </code></pre>
  
  <p>but if I pass following JSON </p>
  
  <pre><code>{
    "abc":{
      "ccc":"ddd",
      "eee":"fff",
      "ggg":[{"aaa":"a","bbb":"b"}]
     }
  }
  </code></pre>
  
  <p>It gives following error</p>
  
  <pre>
   ERROR 2016-04-23 21:15:57,407 [[datawave-demo].HTTP_Listener_Configuration.worker.01] org.mule.exception.DefaultMessagingExceptionStrategy: 
      ********************************************************************************
      Message: Exception while executing: 
          "ggg":["aaaa","bbb"]
          ^
      Cannot coerce a :array to a :object
      Type                : com.mulesoft.weave.mule.exception.WeaveExecutionException
      Code                  : MULE_ERROR--2
      ********************************************************************************
       Exception stack is:
       1. Cannot coerce a :array to a :object  (com.mulesoft.weave.model.values.coercion.exception.UnsupportedTypeCoercionException)
    com.mulesoft.weave.model.values.coercion.ObjectTypeCoercionValue:31 (null)
  2. Exception while executing: 
          "ggg":["aaaa","bbb"]
          ^
  Cannot coerce a :array to a :object (com.mulesoft.weave.mule.exception.WeaveExecutionException)
    com.mulesoft.weave.mule.WeaveMessageProcessor$WeaveOutputHandler:166 (null)
  ********************************************************************************
  Root Exception stack trace:
  com.mulesoft.weave.model.values.coercion.exception.UnsupportedTypeCoercionException: Cannot coerce a :array to a :object
      at com.mulesoft.weave.model.values.coercion.ObjectTypeCoercionValue.evaluate(ObjectTypeCoercionValue.scala:31)
      at com.mulesoft.weave.model.values.coercion.ObjectTypeCoercionValue.evaluate(ObjectTypeCoercionValue.scala:13)
      at com.mulesoft.weave.writer.xml.XmlWriter.writeObject(XmlWriter.scala:109)
      at com.mulesoft.weave.writer.xml.XmlWriter.writeValue(XmlWriter.scala:98)
      at com.mulesoft.weave.model.values.Value$class.write(Value.scala:31)
      at com.mulesoft.weave.model.values.coercion.ObjectTypeCoercionValue.write(ObjectTypeCoercionValue.scala:13)
      at com.mulesoft.weave.writer.xml.XmlWriter.writeValue(XmlWriter.scala:95)
      at com.mulesoft.weave.model.values.Value$class.write(Value.scala:31)
      at com.mulesoft.weave.reader.json.JsonArray.write(JsonArray.scala:9)
      at com.mulesoft.weave.writer.xml.XmlWriter$$anonfun$writeObject$1.apply(XmlWriter.scala:151)
      at com.mulesoft.weave.writer.xml.XmlWriter$$anonfun$writeObject$1.apply(XmlWriter.scala:119)
      at scala.collection.Iterator$class.foreach(Iterator.scala:750)
      at com.mulesoft.weave.reader.json.JsonObjectSeq.foreach(JsonObjectSeq.scala:11)
      at com.mulesoft.weave.writer.xml.XmlWriter.writeObject(XmlWriter.scala:118)
      at com.mulesoft.weave.writer.xml.XmlWriter.writeValue(XmlWriter.scala:98)
      at com.mulesoft.weave.model.values.Value$class.write(Value.scala:31)
      at com.mulesoft.weave.reader.json.JsonObject.write(JsonObject.scala:10)
      at com.mulesoft.weave.writer.xml.XmlWriter$$anonfun$writeObject$1.apply(XmlWriter.scala:151)
      at com.mulesoft.weave.writer.xml.XmlWriter$$anonfun$writeObject$1.apply(XmlWriter.scala:119)
      at scala.collection.Iterator$class.foreach(Iterator.scala:750)
      at com.mulesoft.weave.reader.json.JsonObjectSeq.foreach(JsonObjectSeq.scala:11)
      at com.mulesoft.weave.writer.xml.XmlWriter.writeObject(XmlWriter.scala:118)
      at com.mulesoft.weave.writer.xml.XmlWriter.writeValue(XmlWriter.scala:98)
      at com.mulesoft.weave.model.values.Value$class.write(Value.scala:31)
      at com.mulesoft.weave.reader.json.JsonObject.write(JsonObject.scala:10)
      at com.mulesoft.weave.model.values.wrappers.DelegateValue$class.write(DelegateValue.scala:29)
      at com.mulesoft.weave.engine.ast.variables.VariableReferenceNode.write(VariableReferenceNode.scala:9)
      at com.mulesoft.weave.engine.Engine.internalExecute(Engine.scala:98)
      at com.mulesoft.weave.engine.Engine.execute(Engine.scala:67)
      at com.mulesoft.weave.engine.Engine.execute(Engine.scala:203)
      at com.mulesoft.weave.mule.WeaveMessageProcessor$WeaveOutputHandler.write(WeaveMessageProcessor.scala:163)
      at org.mule.transformer.simple.ObjectToByteArray.doTransform(ObjectToByteArray.java:63)
      at org.mule.transformer.AbstractTransformer.transform(AbstractTransformer.java:415)
      at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:425)
      at org.mule.DefaultMuleMessage.getPayload(DefaultMuleMessage.java:373)
      at org.mule.DefaultMuleMessage.getPayloadAsBytes(DefaultMuleMessage.java:719)
      at org.mule.module.http.internal.listener.HttpResponseBuilder.build(HttpResponseBuilder.java:190)
      at org.mule.module.http.internal.listener.HttpMessageProcessorTemplate.sendResponseToClient(HttpMessageProcessorTemplate.java:97)
      at org.mule.execution.AsyncResponseFlowProcessingPhase.runPhase(AsyncResponseFlowProcessingPhase.java:77)
      at org.mule.execution.AsyncResponseFlowProcessingPhase.runPhase(AsyncResponseFlowProcessingPhase.java:34)
      at org.mule.execution.PhaseExecutionEngine$InternalPhaseExecutionEngine.phaseSuccessfully(PhaseExecutionEngine.java:65)
      at org.mule.execution.PhaseExecutionEngine$InternalPhaseExecutionEngine.phaseSuccessfully(PhaseExecutionEngine.java:69)
      at com.mulesoft.mule.throttling.ThrottlingPhase.runPhase(ThrottlingPhase.java:185)
      at com.mulesoft.mule.throttling.ThrottlingPhase.runPhase(ThrottlingPhase.java:1)
      at org.mule.execution.PhaseExecutionEngine$InternalPhaseExecutionEngine.process(PhaseExecutionEngine.java:114)
      at org.mule.execution.PhaseExecutionEngine.process(PhaseExecutionEngine.java:41)
      at org.mule.execution.MuleMessageProcessingManager.processMessage(MuleMessageProcessingManager.java:32)
      at org.mule.module.http.internal.listener.DefaultHttpListener$1.handleRequest(DefaultHttpListener.java:127)
      at org.mule.module.http.internal.listener.grizzly.GrizzlyRequestDispatcherFilter.handleRead(GrizzlyRequestDispatcherFilter.java:83)
      at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
      at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
      at org.glassfish.gri...
  </pre>