That is because _media_unserialize_xml converts the tree of SimpleXMLElements to an array. It uses simple casts to do that recursively. But if you cast SimpleXMLElements to arrays, all subelements using XML namespaces will be dropped.