public function retrieve($format = null)
    {
        if ( is_null($format) ) {
            $format = $this->format;
        }
        if ( is_null($format) ) {
            throw new InvalidException('You must provide a format to retrieve the document');
        }
        $format = strtolower($format);

        try {
            $result     = $this->getSoapClient()->RetrieveDocument(array(
                'format' => $format ,
            ));
            $this->data = base64_decode($result->RetrieveDocumentResult);

            return $this->data;
        } catch ( SoapException $ex ) {
            throw new RetrieveException('Error while retrieving the final document from Livedocx service' , $ex);
        }
    }