$xml = simplexml_load_string($xml);
this code, when there is only one itme, no problem, but when you have more than one item, you will report an error bool (false) bool (false)
use the code in else, there is no problem with multiple item, and when you have one item, you will report an error
to solve the problem!