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.
return null;
  },
  setAttribute: function DOMElement_setAttribute(name, value) {
    value = value || "";
    value = xmlEncode(value);
    this.attributes[name] = value;
  },
  setAttributeNS: function DOMElement_setAttributeNS(NS, name, value) {
    this.setAttribute(name, value);
  },
  appendChild: function DOMElement_appendChild(element) {
    const childNodes = this.childNodes;
    if (!childNodes.includes(element)) {
      childNodes.push(element);
    }
  },
  hasChildNodes: function DOMElement_hasChildNodes() {
    return this.childNodes.length !== 0;
  },
  cloneNode: function DOMElement_cloneNode() {
    const newNode = new DOMElement(this.nodeName);
    newNode.childNodes = this.childNodes;
    newNode.attributes = this.attributes;
    newNode.textContent = this.textContent;
    return newNode;
  },
  
  
  
  toString: function DOMElement_toString() {