--TEST-- test if the ' and " entities are not converted --SKIPIF-- if (!extension_loaded('dom')) { die('skip DOM extension not loaded.'); } --FILE-- // create document (keep it simple) $domImp = new DomImplementation(); $dom = $domImp->createDocument(null, 'root'); // create element with the entities $foo = $dom->createElement('foo', '' "'); // bug here $dom->documentElement->appendChild($foo); echo $dom->saveXML(); --EXPECT-- ' "