protected function queryPath($path) { $xpath = $this->xPath(); $result = $xpath->query($path); if (is_object($result) && $result->length > 0) { return trim($result->item(0)->nodeValue); } else { return null; } }