public function writeLeaf(Leaf $leaf, $level = null) { $newLine = $this->isPretty() ? $this->getNewLine() : ''; $str = ''; if ($leaf instanceof Document) { $str .= "<!DOCTYPE " . $leaf->getDocumentType() . ">" . $newLine; } return $str . parent::writeLeaf($leaf); }
public function __clone() { parent::__clone(); foreach ($this->_children as $i => $child) { $this->appendChild(clone $child); } }