public function text($val=null)
    {
        if ($val !== null) { // set node value for all nodes
            foreach ($this->nodes as $node) {
                $node->nodeValue = $val;
            }

            return $this;
        }
        if ($node = $this->getFirstElmNode()) { // get value for first node
            return $node->nodeValue;
        }
    }