Here you can find the source of copyAttributes(SOAPElement target, Element source)
public static void copyAttributes(SOAPElement target, Element source)
//package com.java2s; import org.w3c.dom.*; import javax.xml.soap.SOAPElement; public class Main { public static void copyAttributes(SOAPElement target, Element source) { NamedNodeMap attrs = source.getAttributes(); for (int i = 0; i < attrs.getLength(); i++) { Node nd = attrs.item(i); target.setAttribute(nd.getNodeName(), nd.getNodeValue()); }// w w w.ja v a 2 s .c om } }