class WFSNodeWriter {

    public static void writeToNode(Node node, List<WFSLayerState> layerStates)
    {
        Document doc = node instanceof Document ? (Document)node : node.getOwnerDocument();
        try
        {
            Element dataLayerNode = (Element)StateXML.createChildNode(node, doc, node, StateConstants.DATA_LAYERS_PATH,
                    StateConstants.LAYERS_NAME);
            dataLayerNode.setAttribute("type", StateConstants.DATA_LAYERS_TYPE);
            addToNode(dataLayerNode, layerStates);
        }
        catch (XPathExpressionException e)
        {
            LOGGER.error(e.getMessage(), e);
        }
    }

    private  WFSNodeWriter();

}