class XmlNodeConverter implements NodeConverter {

    @Override
    public Writer serializeRpc(final SchemaNode schemaNode, final NormalizedNode<?, ?> normalizedNode)
            throws SerializationException {
        Writer writer = new StringWriter();
        XMLStreamWriter xmlStreamWriter = createXmlStreamWriter(writer);
        URI namespace = schemaNode.getQName().getNamespace();
        String localName = schemaNode.getQName().getLocalName();
        try (NormalizedNodeWriter normalizedNodeWriter =
                createNormalizedNodeWriter(schemaContext, xmlStreamWriter, schemaNode.getPath())) {
            // the localName may be "input" or "output" - this may be changed
            xmlStreamWriter.writeStartElement(XMLConstants.DEFAULT_NS_PREFIX, localName, namespace.toString());
            xmlStreamWriter.writeDefaultNamespace(namespace.toString());
            for (NormalizedNode<?, ?> child : ((ContainerNode) normalizedNode).getValue()) {
                normalizedNodeWriter.write(child);
            }
            normalizedNodeWriter.flush();
            xmlStreamWriter.writeEndElement();
            xmlStreamWriter.flush();
        } catch (IOException | XMLStreamException ioe) {
            throw new SerializationException(ioe);
        }
        return writer;
    }

    public  XmlNodeConverter(final SchemaContext schemaContext);

}