/** * @param NodeList $nodelist An XPath query reesult * @param boolean $clean Clean field or not, defaults to true * @return string field */ public function get_text_content($nodelist, $clean = true) { $field = ''; if ($nodelist->length) { $field = $nodelist->item(0)->textContent; if ($clean) { $field = $this->clean_field($field); } } return $field; }