<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_input_by_xpath(self, xpath, value):
 """ Set the value of form element by xpath :param xpath: xpath path :param value: value which should be set to element """


        elem = self.select(xpath).node()

        if self._lxml_form is None:
            # Explicitly set the default form
            # which contains found element
            parent = elem
            while True:
                parent = parent.getparent() # pylint: disable=no-member
                if parent.tag == 'form':
                    self._lxml_form = parent
                    break

        # pylint: disable=no-member
        return self.set_input(elem.get('name'), value)