I can't be sure since I don't typically use simplexmlelement's, but I think you should just be able to cast them to arrays if you want arrays. It's not recursive though. It may be easier to just use the simplexmlelement than to use an array though.
What's the XML that you're using for this?
header('HTTP/1.1 420 Enhance Your Calm');