def get_json(self, instance=True):
        '''get_json

        High-level api: get_json returns json_val of the config node.

        Parameters
        ----------

        instance : `bool`
            True if only one instance of list or leaf-list is required. False if
            all instances of list or leaf-list are needed.

        Returns
        -------

        str
            A string in JSON format.
        '''

        def get_json_instance(node):
            pk = Parker(xml_fromstring=_fromstring, dict_type=OrderedDict)
            default_ns = {}
            nodes = [node] + node.findall('.//')
            for item in nodes:
                parents = [p for p in node.findall('.//{}/..'.format(item.tag))
                          if item in p.findall('*')]
                if parents and id(parents[0]) in default_ns:
                    default_url = default_ns[id(parents[0])]
                    ns, tag = self.device.convert_tag(default_url, item.tag,
                                                      dst=Tag.JSON_NAME)
                else:
                    ns, tag = self.device.convert_tag('', item.tag,
                                                      dst=Tag.JSON_NAME)
                default_ns[id(item)] = ns
                item.tag = tag
            return pk.data(node, preserve_root=True)

        def convert_node(node):
            # lxml.etree does not allow tag name like oc-if:enable
            # so it is converted to xml.etree.ElementTree
            string = etree.tostring(node, encoding='unicode',
                                    pretty_print=False)
            return ElementTree.fromstring(string)

        if instance:
            return json.dumps(get_json_instance(convert_node(self.node)))
        else:
            nodes = [n for n in self.node.getparent() \
                                         .iterchildren(tag=self.node.tag)]
            if len(nodes) > 1:
                return json.dumps([get_json_instance(convert_node(n))
                                   for n in nodes])
            else:
                return json.dumps(get_json_instance(convert_node(nodes[0])))