SimpleXMLElement cannot be found when working with namespaces
I'm trying to create a Widget in Wordpress, and I'm running into an issue creating a SimpleXMLElement object. Here is the code: namespace GenieKnows_Search; class GenieKnows_Search_Widget extends \WP_Widget { //Constructor function __construct() { parent::__construct('genieknows_search_widget', 'GenieKnows_Search_Widget'); } //Irrelevant Code. Removed for readability. //Return the XML function retrieve_gk_xml() { $xml = new SimpleXMLElement($this->create_gk_xml(), 0, true); //Line 114 return $xml->xpath('/feed/results/sponsored/listing'); } } Here is the error: PHP Fatal error: Class