public function addBindingOperation(DOMElement $binding, $name, array $input = null, array $output = null)
    {
        $operation = $this->dom->createElement('operation');
        $operation->setAttribute('name', $name);

        if (is_array($input)) {
            $inputElement = $this->dom->createElement('input');
            $soapElement = $this->dom->createElement('soap:body');
            foreach ($input as $name => $value) {
                $soapElement->setAttribute($name, $value);
            }

            $inputElement->appendChild($soapElement);
            $operation->appendChild($inputElement);
        }

        if (is_array($output)) {
            $outputElement = $this->dom->createElement('output');
            $soapElement = $this->dom->createElement('soap:body');
            foreach ($output as $name => $value) {
                $soapElement->setAttribute($name, $value);
            }

            $outputElement->appendChild($soapElement);
            $operation->appendChild($outputElement);
        }

        $binding->appendChild($operation);

        return $operation;
    }