Q:

PHP DOMDocument - How to force using numeric character references or entities, not UTF8

I have a DOMDocument to which I am appending some nodes. 
In some of the text contents, there are special characters as ©, –, δ etc...
My goal is when inserting those characters in the DOMDocument, that they will be converted to numeric character references (NCR) or entities, respectively:
© - &#x000A9;
– - &#x2013;
δ - &#x3B4;

A:

Set the encoding to a character set that doesn't contain those characters, for example us-ascii. 
Example:
$dom = new DOMDocument();
$dom->loadXML('<foo>©</foo>');
$dom->encoding = 'us-ascii';
print($dom->saveXML());

leads to:
<? xml version="1.0" encoding="us-ascii"? >
<foo>&#169;</foo>

To change the entities into hex you can apply something like
preg_replace('/&#([0-9]+);/e', '\'&#x\'.strtoupper(dechex($1)).\';\'', $xml);

to the XML output.