title: XmlWriter <image:image>
body: <p>Apologies if this is obvious but I am trying to write some xml for a sitemap like this:</p>
  
  <pre><code>&lt;url&gt;
      &lt;loc&gt;http://...&lt;/loc&gt;
      &lt;priority&gt;0.5&lt;/priority&gt;
      &lt;image:image&gt;
        &lt;image:loc&gt;http://...&lt;/image:loc&gt;
       &lt;/image:image&gt;
  &lt;/url&gt;
  </code></pre>
  
  <p>With the following code:</p>
  
  <pre><code>    const string locationPrefix = "loc";
      const string imagePrefix = "image";
      writer.WriteStartElement("image", imagePrefix);
      writer.WriteStartElement("image", locationPrefix);
      writer.WriteValue(imageUrl);
      writer.WriteEndElement(); // &lt;/image:loc&gt;
      writer.WriteEndElement(); // &lt;/image:image&gt;
  </code></pre>
  
  <p>But am getting this instead.</p>
  
  <pre><code>&lt;image xmlns="image"&gt;
     &lt;image xmlns="loc"&gt;http://...&lt;/image&gt;
   &lt;/image&gt;
  </code></pre>
  
  <p>Could someone tell me where I am going wrong here?</p>
  
  <p><strong>Edit</strong>: this did it</p>
  
  <pre><code>writer.WriteStartElement("image", imagePrefix, null);
  </code></pre>