Fix SimpleXMLElement clone

Fixed crash when using XPath on the cloned SimpleXMLElement.