function setXML($xml_string) { $this->xml = $xml_string; $this->doc = @domxml_open_mem($xml_string, DOMXML_LOAD_PARSING, $this->errors); if (!$this->doc) { return false; } $this->xpath = $this->doc->xpath_new_context(); return true; }