I have SOAPMessage, which created from parsed xml-file. How can I insert a new Element (SOAPElement or Node) between two other elements? Now it appends only like last child (with addChildElement or appendChild), in the end of current NodeList. The method insertBefore throws the exception:
"org.w3c.dom.DOMException: HIERARCHY_REQUEST_ERR: An attempt was made to insert a node where it is not permitted. "