docs: public void copyAttributes(Document doc, Element eold, Element enew) {
      if(eold.hasAttributes()) {
        NamedNodeMap attr = eold.getAttributes();
        int len = attr.getLength();
        for(int i = 0; i < len; i++) {
          enew.setAttributeNode((Attr) doc.importNode(attr.item(i), true));
        }
      }
    }