/** * Insert Node * * This method adds a new XML node. Node could be a instance of xmlTag, an * array of valid values, a boolean or a string. * * @param xmlTag|array|boolean|string $node Node value */ public function insertNode($node = null) { if ($node instanceof self) { $this->_nodes[] = $node; } elseif (is_array($node)) { $child = new self(null); foreach ($node as $tag => $n) { $child->insertNode(new self($tag, $n)); } $this->_nodes[] = $child; } elseif (is_bool($node)) { $this->_nodes[] = $node ? '1' : '0'; } else { $this->_nodes[] = (string) $node; } }