Thursday, August 29, 2013

Converting xml Node or Element to String

            Document document = payloadElem.getOwnerDocument();
            DOMImplementationLS domImplLS = (DOMImplementationLS) document.getImplementation();
            LSSerializer serializer = domImplLS.createLSSerializer();
            String str = serializer.writeToString(payloadElem);
            System.out.println(str);

No comments:

Post a Comment