resolved PHP warnings when converting object to array

SimpleXMLElement::xpath() is throwing two warnings;
* Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: Unfinished literal
* Warning: SimpleXMLElement::xpath() [simplexmlelement.xpath]: xmlXPathEval: evaluation failed

Leaving the item as an object (rather than casting as an array) resolves the problem.