<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_by_name(self, name, index=0):
 """ Remove the child having the given name at the given position :type name: ``str`` :param name: child name (e.g. PID) :type index: ``int`` :param index: child index :return: an instance of :class:`Element <hl7apy.core.Element>` subclass """

        child = self.child_at_index(name, index)
        self.remove(child)
        return child