Easiest way to convert array into xml string?
<p>So I'm trying to convert an array to an XML document (just outputting it as a string). I know php has <code>json_encode</code> built in and it works fine, but I can't seem to find any good XML equivalents.</p>

<p>Basically, the array is the result of a <code>PDOStatement-&gt;fetchAll();</code> </p>

<p>I'd like the output to look like this:</p>

<pre><code>&lt;arrayitem&gt;
   &lt;iteminfo1&gt;text&lt;/iteminfo1&gt;
   &lt;iteminfo2&gt;text&lt;/iteminfo2&gt;
   &lt;iteminfo3&gt;text&lt;/iteminfo3&gt;
   &lt;iteminfo4&gt;text&lt;/iteminfo4&gt;
   &lt;iteminfo5&gt;text&lt;/iteminfo5&gt;
&lt;/arrayitem&gt;
</code></pre>
