change xml format of JMSSerializer

172 Views Asked by At

I have an array like this:

$a = array("test" => 
                    array("foo" => "bar")
          );

By serilizing it as xml, I expected to get something like:

<test>
     <foo>bar</foo>
</test>

But I get:

<result>
  <entry>
    <entry><![CDATA[bar]]></entry>
  </entry>
</result>

How is possible to get the xml the way I described above with JMSSerializer? I know this is possible with Annotation, but I need to do it with php, so which methods should I call to setup xmlRoot and xmlValue et.c?

0

There are 0 best solutions below