Code example for DOMImplementationLS

Methods: createLSOutput, createLSSerializer

     * @param output the writer to write the XML to 
    public static void writeNode(Node node, Writer output) {
        DOMImplementation domImpl = node.getOwnerDocument().getImplementation();
        DOMImplementationLS domImplLS = (DOMImplementationLS) domImpl.getFeature("LS", "3.0");
        LSSerializer serializer = domImplLS.createLSSerializer();
        LSOutput serializerOut = domImplLS.createLSOutput();
        serializer.write(node, serializerOut);
     * Converts a QName into a string that can be used for attribute values or element content. 
     * @param qname the QName to convert to a string 
     * @return the string value of the QName 
    public static String qnameToContentString(QName qname) {