/** * Retorna a representacao do node como objeto * * @author Hugo Ferreira da Silva * @param boolean $withChilds Indica se tambem e para pegar os nos filhos ou nao * @return array */ public function toObject($withChilds = true) { $node = $this->obj->toObject(); $node->childNodes = array(); if ($withChilds) { $list = $this->getChildNodes(); $list->reset(); while ($child = $list->nextSibling()) { $node->childNodes[] = $child->toObject($withChilds); } } return $node; }