setAttributeNodeNS

The setAttributeNodeNS() method of the Element interface adds a new namespaced Attr node to an element.

MDN Reference