title: How to Construct xml in php with Special Characters?
body: <p>My user enters message with special characters as follows:</p>
  
  <pre><code>this is a test of &amp;amp;&amp;amp;, &amp;amp;&amp;amp;, % as well as '' &amp;quot;&amp;quot;, &amp;quot; instead of this is a test of &amp;, &amp;&amp;, % as well as '' "", "
  </code></pre>
  
  <p>I need to construct XML as follows:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='iso-8859-1'?&gt;
  &lt;success&gt;
  &lt;message&gt;
  this is a test of &amp;amp;, &amp;amp;&amp;amp;, % as well as '' &amp;quot;&amp;quot;, &amp;quot; instead of this is a test of &amp;, &amp;&amp;, % as well as '' "", "
  &lt;/message&gt;
  &lt;/success&gt;
  </code></pre>
  
  <p>Can any body help me?
  Thanks in advance</p>