private function convertToHtml(Element $topNode) { if (empty($topNode)) { return ''; } return $topNode->ownerDocument->saveHTML($topNode); }