Looking through http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-357.pdf I couldn't find a method that would suit.
In your example you are just setting the description attribute. A way that would pass linting for that specific example would be:
var desc = 'uh-oh';
var errorXml = new XML('<error description=\"' + desc + '\"></error>');