& should ALWAYS be escaped in XML. That's because & IS the XML escape character.<br>So if you want a raw & it's &amp;<br><br>From <a href="http://www.w3.org/TR/2006/REC-xml-20060816/#syntax" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.w3.org/TR/2006/REC-xml-20060816/#syntax
</a> :<br><br>'The ampersand character (&) and the left angle bracket (<) <em title="Keyword in RFC 2119 context">MUST NOT</em> appear
in their literal form, except when used as markup delimiters, or
within a <a title="Comment" href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-comment" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">comment</a>, a <a title="Processing instruction" href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-pi" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
processing
instruction</a>, or a <a title="CDATA Section" href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-cdsection" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">CDATA section</a>.

If they are needed elsewhere, they <em title="Keyword in RFC 2119 context">MUST</em> be <a title="escape" href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-escape" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
escaped</a>
using either <a title="Character Reference" href="http://www.w3.org/TR/2006/REC-xml-20060816/#dt-charref" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">numeric character references</a>
or the strings "<code>&amp;</code>" and "<code>&lt;</code>"
respectively.'<br><br><div><span class="gmail_quote">On 05/11/06, <b class="gmail_sendername">Dean Earley</b> <<a href="mailto:dean@earlsoft.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
dean@earlsoft.co.uk</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Jon Burgess wrote:<br>> I've found that both osm-subset.pl and Geo::OSM::Write fail to escape<br>> characters like " & ' in tags leading to problem when trying to parse<br>> the OSM that they write.<br>
>
<br>> The attached patches made them work for me although I still seem to be<br>> seeing some UTF-8 related issues (though UTF8sanitizer fixes these up).<br>> Does anyone know if there is a better way to be generating valid XML?
<br>><br>> The patch to osm-subset.pl also fixes it to work with .bz2 compressed<br>> planet.osm files.<br><br> From memory, & SHOULDN'T be escaped in XML files.<br>I was surprised when I read this but it fixed my RSS feed.. :)
<br><br>--<br>Dean Earley, Dee (<a href="mailto:dean@earlsoft.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dean@earlsoft.co.uk</a>)<br><br>irc:    irc://irc.blitzed.org/<br>web:    <a href="http://personal.earlsoft.co.uk" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://personal.earlsoft.co.uk</a><br>
phone:  +44 (0)780 8369596<br><br>_______________________________________________<br>dev mailing list<br><a href="mailto:dev@openstreetmap.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dev@openstreetmap.org
</a><br><a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev</a><br></blockquote></div><br>