1--TEST-- 2Serialize entity reference 3--EXTENSIONS-- 4dom 5--FILE-- 6<?php 7 8$dom1 = new DOMDocument(); 9$root = $dom1->appendChild($dom1->createElement('root')); 10$root->appendChild($dom1->createEntityReference('nbsp')); 11 12$dom2 = Dom\HTMLDocument::createEmpty(); 13$dom2->appendChild($dom2->importLegacyNode($root, true)); 14 15echo $dom2->saveXml(), "\n"; 16echo $dom2->saveHtml(), "\n"; 17 18?> 19--EXPECT-- 20<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 21<root> </root> 22<root> </root> 23