I found ( here ) an answer about a way to delete a node of a SimpleXMLElement object.
The problem is, I can't figure out how it goes.
I mean, $ image var is a link, right? So what and where, what $image[0][0] ?
$image[0][0]
SimpleXMLElement represents a massive interface on its child nodes using magic methods. This is due to custom __unset behavior that causes SimpleXMLElement to act as a "member" (child) of its "array" (set of children) removed.
SimpleXMLElement
__unset
If you put print_r ($ image) right after $ image = $ galleries-> xpath (...
you will see:
Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [name] => Hansio ) ) )