<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def prepare_soap_body(self, method, parameters, namespace):
 """Prepare the SOAP message body for sending. Args: method (str):
 The name of the method to call. parameters (list):
 A list of (name, value) tuples containing the parameters to pass to the method. namespace (str):
 tThe XML namespace to use for the method. Returns: str: A properly formatted SOAP Body. """


        tags = []
        for name, value in parameters:
            tag = "<{name}>{value}</{name}>".format(
                name=name, value=escape("%s" % value, {'"': "&quot;"}))
            # % converts to unicode because we are using unicode literals.
            # Avoids use of 'unicode' function which does not exist in python 3
            tags.append(tag)

        wrapped_params = "".join(tags)
        # Prepare the SOAP Body
        if namespace is not None:
            soap_body = (
                '<{method} xmlns="{namespace}">'
                '{params}'
                '</{method}>'.format(
                    method=method, params=wrapped_params,
                    namespace=namespace
                ))
        else:
            soap_body = (
                '<{method}>'
                '{params}'
                '</{method}>'.format(
                    method=method, params=wrapped_params
                ))

        return soap_body