title: Using PHP to include a colon within a XML child elements name
body: <p>I'm trying to have my sitemap update automatically as pages are added. I'm defining var containing the child name I need, which is including a colon character. PHP or XML is removing the colon and word to the right or left of it. How can I keep that colon in the child elements name?</p>
  
  <p>I'm using this:</p>
  
  <pre><code>&lt;?php
  $imagechild = 'image:image';
  $imageloc = 'image:loc';
  
   $xml=simplexml_load_file("sitemap.xml");
  
   $map = $xml-&gt;addChild('url');
     $map-&gt;addChild('loc', "http:/some website".$page_path);
  
   $img = $map-&gt;addChild($imagechild);
     $img-&gt;addChild($imageloc, $img_link);
  
       $xml-&gt;saveXML('sitemap.xml');
  ?&gt;
  </code></pre>
  
  <p>I'm getting this:</p>
  
  <pre><code>      &lt;url&gt;
          &lt;loc&gt;web url&lt;/loc&gt;
          &lt;image&gt;
            &lt;loc&gt;image url&lt;/loc&gt;
          &lt;/image&gt;
        &lt;/url&gt;
  </code></pre>
  
  <p>I need this</p>
  
  <pre><code>      &lt;url&gt;
          &lt;loc&gt;web url&lt;/loc&gt;
          &lt;image:image&gt;
            &lt;loc&gt;image url&lt;/loc&gt;
          &lt;/image:image&gt;
        &lt;/url&gt;
  </code></pre>
  
  <p>Thank you in advance!</p>