El objeto cargado antes era realmente un objeto de la clase SimpleXMLElement. Esta clase es la base de la extensión SimpleXML. Vamos a iniciar el archivo xml instanciando esta clase de ahora en ...
…hin foreach This happens because getName() resets the iterator to the start because it overwrites the iterator data. We add a version of get_first_node that does not overwrite the iterator data.