https://github.com/mozilla/pdf.js/blob/9bed695ebde488b49d39290087f72ba224bd1078/examples/node/domstubs.js#L84-L87
```javascript
  setAttributeNS: function DOMElement_setAttributeNS(NS, name, value) {
    value = value || '';
    value = xmlEncode(value);
    this.attributes[name] = value;
```

https://github.com/mozilla/pdf.js/blob/9bed695ebde488b49d39290087f72ba224bd1078/examples/node/domstubs.js#L105

```javascript
      buf.push(' ' + i + '="' + xmlEncode(this.attributes[i]) + '"');
```

One of the two should be removed. Most likely the first one, because `getAttributeNS`'s implementation just returns `this.attributes[i]`, and that should not be encoded.
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */
function xmlEncode(s) {
  let i = 0,
    ch;
  s = String(s);
  while (
    i < s.length &&
    (ch = s[i]) !== "&" &&
    ch !== "<" &&
    ch !== '"' &&
    ch !== "\n" &&
    ch !== "\r" &&
    ch !== "\t"
  ) {
    i++;
  }
  if (i >= s.length) {
    return s;
  }
  let buf = s.substring(0, i);
  while (i < s.length) {
    ch = s[i++];
    switch (ch) {
      case "&":
        buf += "&amp;";
        break;
      case "<":