title: Ampersand problem in XML when creating a URL String
body: <p>I am working with an XML feed that has, as one of it's nodes, a URL string similar to the following:</p>
  
  <pre><code>http://aflite.co.uk/track/?aid=13414&amp;mid=32532&amp;dl=http://www.google.com/&amp;aref=chris
  </code></pre>
  
  <p>I understand that ampersands cause a lot of problems in XML and should be escaped by using <code>&amp;amp;</code> instead of a naked <code>&amp;</code>. I therefore changed the php to read as follows:</p>
  
  <pre><code>&lt;node&gt;&lt;?php echo ('http://aflite.co.uk/track/?aid=13414&amp;amp;mid=32532&amp;amp;dl=http://www.google.com/&amp;amp;aref=chris'); ?&gt;&lt;/node&gt;
  </code></pre>
  
  <p>However when this generates the XML feed, the string appears with the full <code>&amp;amp;</code>
  and so the actual URL does not work. Apologies if this is a very basic misunderstanding but some guidance would be great.</p>
  
  <p>I've also tried using <code>%26</code> instead of <code>&amp;amp;</code> but still getting the same problem.</p>