fix $ not defined error

- the xml document wasn't actually encoded in utf-8
- the js was inserting illegal xhtml (& in a url)
- minor tweaks