<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def multiply(self, x1, x2, out=None):
 """Return the pointwise product of ``x1`` and ``x2``. Parameters x1, x2 : `LinearSpaceElement` Multiplicands in the product. out : `LinearSpaceElement`, optional Element to which the result is written. Returns ------- out : `LinearSpaceElement` Product of the elements. If ``out`` was provided, the returned object is a reference to it. """

        if out is None:
            out = self.element()

        if out not in self:
            raise LinearSpaceTypeError('`out` {!r} is not an element of '
                                       '{!r}'.format(out, self))
        if x1 not in self:
            raise LinearSpaceTypeError('`x1` {!r} is not an element of '
                                       '{!r}'.format(x1, self))
        if x2 not in self:
            raise LinearSpaceTypeError('`x2` {!r} is not an element of '
                                       '{!r}'.format(x2, self))
        self._multiply(x1, x2, out)
        return out