title: DOMDocument::createElement(): unterminated entity reference （PHP)
body: <p>I tried this code in PHP;</p>
  
  <pre><code>$oItem-&gt;appendChild($oDom-&gt;createElement("link", $iItem-&gt;item($i)-&gt;getElementsByTagName("affiliateUrl")-&gt;item(0)-&gt;nodeValue));
  </code></pre>
  
  <p>But it shows error</p>
  
  <blockquote>
    <p>DOMDocument::createElement(): unterminated entity reference</p>
  </blockquote>
  
  <p>Is this because of getElementsByTagName contain <code>&lt; &gt;</code> ?</p>
  
  <p>Please advise how to fix it?</p>
  
  <p>That tag is:</p>
  
  <pre><code>&lt;affiliateUrl&gt;http://hb.afl.rakuten.co.jp/hgc/sd0ps992.2asad607.g00ps016.2asfefe9/?pc=http%3A%2F%2Fitem.rakuten.co.jp%2Fmarukans%2Fno11-1%2F&amp;m=http%3A%2F%2Fm.rakuten.co.jp%2Fmarukans%2Fi%2F10000152%2F&lt;/affiliateUrl&gt;
  </code></pre>
  
  <p>Thank you for your help.</p>