static private void XmlToJsonLayer(XmlNode layerNode, JsonNode jsonNode, XmlToJsonConverter converter)
        {
            XmlNode nameXmlNode  = layerNode.SelectSingleNode("Name");
            XmlNode titleXmlNode = layerNode.SelectSingleNode("Title");

            string name  = nameXmlNode.InnerText;
            string title = "";

            if (titleXmlNode != null)
            {
                title = titleXmlNode.InnerText;
            }

            jsonNode.Add("name", new JsonValue(name));
            jsonNode.Add("title", new JsonValue(title));

            XmlNodeList sublayersXmlNodes = layerNode.SelectNodes("Layer");

            if (sublayersXmlNodes.Count > 0)
            {
                XmlToJsonSublayers(sublayersXmlNodes, jsonNode, converter);
            }

            XmlNode attributesXmlNode = layerNode.SelectSingleNode("Attributes");

            if (attributesXmlNode != null)
            {
                JsonList layerAttributes = new JsonList();
                XmlToJsonAttributes(attributesXmlNode, layerAttributes, converter);
                jsonNode.Add("attributes", layerAttributes);
            }
        }
        static private void XmlToJsonSublayers(XmlNodeList sublayersXmlNodes, JsonNode jsonNode, XmlToJsonConverter converter)
        {
            JsonList sublayersJsonNodes = new JsonList();

            foreach (XmlNode sublayerXmlNode in sublayersXmlNodes)
            {
                JsonObject sublayerJsonNode = new JsonObject();
                converter.Convert(sublayerXmlNode, sublayerJsonNode);
                sublayersJsonNodes.Add(sublayerJsonNode);
            }
            jsonNode.Add("sublayers", sublayersJsonNodes);
        }