protected function unmarshall(DOMElement $element, ResponseProcessing $responseProcessing = null)
    {
        $responseRuleElts = self::getChildElements($element);

        $responseRules = new ResponseRuleCollection();
        for ($i = 0; $i < count($responseRuleElts); $i++) {
            $marshaller = $this->getMarshallerFactory()->createMarshaller($responseRuleElts[$i]);
            $responseRules[] = $marshaller->unmarshall($responseRuleElts[$i]);
        }

        if (is_null($responseProcessing) === true) {
            $object = new ResponseProcessing($responseRules);
        } else {
            $object = $responseProcessing;
            $object->setResponseRules($responseRules);
        }

        if (($template = $this->getDOMElementAttributeAs($element, 'template')) !== null) {
            $object->setTemplate($template);
        }

        if (($templateLocation = $this->getDOMElementAttributeAs($element, 'templateLocation')) !== null) {
            $object->setTemplateLocation($templateLocation);
        }

        return $object;
    }