No further introduction is needed here. This...
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><xml/>');
array2xml([
"element" => "content"
], $xml);
...becomes into this...
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<element>content</element>
</xml>
See the examples for the eureka effect.
Extensible Markup Language was launched in 1998, and it's still a huge pain in most people's arseholes, especially when you need to compose 'em at the programming level. This function allows you to easily output valid XML from a multidimensional array without feeling dizzy when going into the deep end.
If you don't understand why this exists then you clearly haven't dealt with complex structures enough and therefore it's not meant for you.