- for (String attrName : attributes.keySet()) {
- rpcReply.setAttribute(attrName, attributes.get(attrName).getNodeValue());
+ if(XmlElement.fromDomElement(response).hasNamespace()) {
+ rpcReply.appendChild(response);
+ } else {
+ Element responseNS = document.createElementNS(XmlNetconfConstants.URN_IETF_PARAMS_XML_NS_NETCONF_BASE_1_0, response.getNodeName());
+ NodeList list = response.getChildNodes();
+ while(list.getLength()!=0) {
+ responseNS.appendChild(list.item(0));
+ }
+ rpcReply.appendChild(responseNS);