get_xpath

        High-level api: Given a config or schema node, get_xpath returns an
        xpath of the node, which starts from the model root. Each identifier
        uses the `prefix:tagname` notation if argument 'type' is not specified.

        Parameters
        ----------

        node : `Element`
            A config or schema node.

        type : `tuple`
            A tuple constant defined in yang.ncdiff.Tag. Most commonly it could
            be Tag.XPATH or Tag.LXML_XPATH.

        instance : `bool`
            True if the xpath returned points to an instance. The xpath could
            point to a list or leaf-list when instance=False.

        Returns
        -------

        str
            An xpath of the config or schema node, which starts from the model
            root.


        Code Example::

            >>> device.nc.get_xpath(config_node)
            '/oc-if:interfaces/interface[name="GigabitEthernet0/0"]'
            >>> device.nc.get_xpath(config_node, type=Tag.LXML_XPATH)
            '/oc-if:interfaces/oc-if:interface[oc-if:name="GigabitEthernet0/0"]'
            >>>
            >>> device.nc.get_xpath(schema_node)
            '/oc-if:interfaces/interface'
            >>>

def get_xpath(self, node, type=Tag.XPATH, instance=True):
        '''get_xpath

        High-level api: Given a config or schema node, get_xpath returns an
        xpath of the node, which starts from the model root. Each identifier
        uses the `prefix:tagname` notation if argument 'type' is not specified.

        Parameters
        ----------

        node : `Element`
            A config or schema node.

        type : `tuple`
            A tuple constant defined in yang.ncdiff.Tag. Most commonly it could
            be Tag.XPATH or Tag.LXML_XPATH.

        instance : `bool`
            True if the xpath returned points to an instance. The xpath could
            point to a list or leaf-list when instance=False.

        Returns
        -------

        str
            An xpath of the config or schema node, which starts from the model
            root.


        Code Example::

            >>> device.nc.get_xpath(config_node)
            '/oc-if:interfaces/interface[name="GigabitEthernet0/0"]'
            >>> device.nc.get_xpath(config_node, type=Tag.LXML_XPATH)
            '/oc-if:interfaces/oc-if:interface[oc-if:name="GigabitEthernet0/0"]'
            >>>
            >>> device.nc.get_xpath(schema_node)
            '/oc-if:interfaces/interface'
            >>>
        '''

        return Composer(self, node).get_xpath(type, instance=instance)