These should be chained:

```
var xmlvalue = this.value.replace(/&/g, '&amp;')
    .replace(/\"/g, '&quot;');
```

etc instead of creating 4 new temp strings.