title: php utf-8 decode from xml returns question marks
body: <p>I have some problems using xml. I know this is a comon question, but the answers i found didn't fix my problem. The problem is that when I add é or ä or another special char to my xml file, with php domdocument, it saves the é as xE9 and the ä as xE4. I don't know if this is ok but when I want to show the output it shows question marks at this places. 
  I have tried alot. Like removing and adding the encoding in de xml header in the php domdocument. I also tried using file_get_contents and use php utf-8_decode to get the xml. I tried using iso intead, but nothing solved my problem. Instead I got php xml parse errors sometimes. I must do something wrong, but what? Thats my question and how I can solve this problem.
  My xml file looks like this:
  the xE9 and the xE4 have black backgrounds.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;root&gt;
    &lt;row id="1"&gt;
      &lt;question&gt;blah&lt;/question&gt;
      &lt;answer&gt;blah&lt;/answer&gt;
    &lt;/row&gt;
    &lt;row id="2"&gt;
      &lt;question&gt;xE9&lt;/question&gt;
      &lt;answer&gt;xE4&lt;/answer&gt;
    &lt;/row&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>and a part of my php xml class</p>
  
  <pre><code>function __construct($filePath) {
      $this-&gt;file = $filePath;
      $this-&gt;label = array('Vraag', 'Antwoord');
      $xmlStr = file_get_contents($filePath);
      $xmlStr = utf8_decode($xmlStr);
      $this-&gt;xmlDoc = new DOMDocument('1.0', 'UTF-8');
      $this-&gt;xmlDoc-&gt;preserveWhiteSpace = false;
      $this-&gt;xmlDoc-&gt;formatOutput = true;
      //$this-&gt;xmlDoc-&gt;load($filePath);   
      $this-&gt;xmlDoc-&gt;loadXML($xmlStr);
  }       
  </code></pre>
  
  <p>this is the add new row function</p>
  
  <pre><code>//creates new xml row and saves it in xml file
  function addNewRow($question, $answer) {
      $nextAttr = $this-&gt;getNextRowId();
      $parentNode = $this-&gt;xmlDoc-&gt;documentElement;
      $rowNode = $this-&gt;xmlDoc-&gt;createElement('row');
      $rowNode = $parentNode-&gt;appendChild($rowNode);
      $rowNode-&gt;setAttribute('id', $nextAttr);    
      $q = $this-&gt;xmlDoc-&gt;createElement('question');
      $q = $rowNode-&gt;appendChild($q);
      $qText = $this-&gt;xmlDoc-&gt;createTextNode($question);
      $qText = $q-&gt;appendChild($qText);
      $a = $this-&gt;xmlDoc-&gt;createElement('answer');
      $a = $rowNode-&gt;appendChild($a);
      $aText = $this-&gt;xmlDoc-&gt;createTextNode($answer);
      $aText = $a-&gt;appendChild($aText);
      $this-&gt;xmlDoc-&gt;save($this-&gt;file);
  }
  </code></pre>
  
  <p>everything works fine till I add spcial chars. Those are shown as questionmarks.</p>