public function child($index) { $child = $this->node->childNodes->item($index); return $child === null ? null : new Element($child); }