class NodeReader {

    public boolean canActivateState(Node node, boolean activateDataLayer)
    {
        boolean canActivate = false;

        try
        {
            String path = activateDataLayer ? StateConstants.WMS_DATA_LAYER_PATH : StateConstants.WMS_MAP_LAYERS_PATH;

            NodeList wmsNodes = StateXML.getChildNodes(node, path);

            canActivate = wmsNodes.getLength() > 0;
        }
        catch (XPathExpressionException e)
        {
            LOGGER.error(e.getMessage(), e);
        }

        return canActivate;
    }

}