The above "XML to array" code does not work properly if you have several tags on the same level and with the same name, example:
<currenterrors>
<error>
<description>This is a real error...</description>
</error>
<error>
<description>This is a second error...</description>
</error>
<error>
<description>Lots of errors today...</description>
</error>
<error>
<description>This is the last error...</description>
</error>
</currenterrors>
It will then only display the first <error>-tag.
In this case you will need to number the tags automatically or maybe have several arrays for each new element.