How can I convert this PHP array into XML? I am using PHP codegniter. Is there any method or library for converting an array into XML? Here is my PHP array code. What am I doing wrong?
Array
(
    [0] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [id] => 1
                )
            [timecode] => 12:23:55:142
            [datetimecode] => 11:30:01:06 2016/10/14
            [color] => Green
            [user] => logger 1
            [comment] => Jdjd
            [framecode] => 1115899
        )
    [1] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [id] => 2
                )
            [timecode] => 06:12:04:02
            [datetimecode] => 11:30:05:15 2016/10/14
            [color] => Magenta
            [user] => logger 1
            [comment] => Ndnnd
Ndnnd
            [framecode] => 558109
        )
    [2] => SimpleXMLElement Object
        (
            [@attributes] => Array
                (
                    [id] => 3
                )
            [timecode] => 06:12:13:17
            [datetimecode] => 12:32:34:07 2016/10/14
            [color] => White
            [user] => logger 1
            [comment] => Dd
            [framecode] => 558349
        )
)
 
     
    