title: How to create a sitemap.xml file using R and the {XML} package?
body: <p>I have a vector of links from which I would like to create a sitemap.xml file (file protocol is available from here:  <a href="http://www.sitemaps.org/protocol.html" rel="nofollow noreferrer">http://www.sitemaps.org/protocol.html</a>)</p>
  
  <p>I understand the sitemap.xml protocol (it is rather simple), but I'm not sure what is the smartest way to use the {XML} package for it.</p>
  
  <p>A simple example:</p>
  
  <pre><code> links &lt;- c("http://r-statistics.com",
               "http://www.r-statistics.com/on/r/",
               "http://www.r-statistics.com/on/ubuntu/")
  </code></pre>
  
  <p>How can "links" be used to construct a sitemap.xml file?</p>