when xml is parsed by simplexml functions, its elements can be accessed as array. however the information is not persistent and cannot be saved in sessions (you get error 'node no longer exists').
in order to save the xml data or any particular nodes in session in array format, data must be converted to an array.
this is based on a function from one of the comments in simplexml functions page. this is a simple no-frills function and will not handle attributes.
PHP: