protected function getServiceIdData(Lead $lead, $serviceId = '875')
    {
        $xmlDoc                     = new \DOMDocument('1.0');
        $xmlDoc->preserveWhiteSpace = false;

        $root = $xmlDoc->createElement('Contact');

        $name = $xmlDoc->createElement('Name');
        $name->setAttribute('type', 'C');
        $name->appendChild($xmlDoc->createElement('First', $lead->getFirstname()));
        $name->appendChild($xmlDoc->createElement('Last', $lead->getLastname()));

        $names = $xmlDoc->createElement('Names');
        $names->appendChild($name);
        $root->appendChild($names);

        if ($lead->getAddress1()) {
            $address = $xmlDoc->createElement('Address');
            $address->setAttribute('score', '1');
            $address->appendChild($xmlDoc->createElement('Street', $lead->getAddress1()));
            $address->appendChild($xmlDoc->createElement('City', $lead->getCity()));
            $address->appendChild($xmlDoc->createElement('ST', $lead->getState()));
            $address->appendChild($xmlDoc->createElement('postal', $lead->getZipcode()));

            $addresses = $xmlDoc->createElement('Addresses');
            $addresses->appendChild($address);
            $root->appendChild($addresses);
        }

        $phone = preg_replace('/\D+/', '', $lead->getPhone());
        if (empty($phone)) {
            $phone = preg_replace('/\D+/', '', $lead->getMobile());
        }
        $phone = substr($phone, -10);
        if (10 === strlen($phone)) {
            $phone = $xmlDoc->createElement('Phone', $phone);
            $phone->setAttribute('score', '1');
            $phone->setAttribute('appends', 'validation,mobile,active');

            $phones = $xmlDoc->createElement('Phones');
            $phones->appendChild($phone);
            $root->appendChild($phones);
        }

        if ($lead->getEmail()) {
            $email = $xmlDoc->createElement('eMail', $lead->getEmail());
            $email->setAttribute('score', '1');

            $emails = $xmlDoc->createElement('eMailAddresses');
            $emails->appendChild($email);
            $root->appendChild($emails);
        }

        $xmlDoc->appendChild($root);

        return $xmlDoc->saveXML();
    }
protected function getServiceIdData(Lead $lead, $serviceId = '875')
    {
        $xmlDoc                     = new \DOMDocument('1.0');
        $xmlDoc->preserveWhiteSpace = false;

        $root = $xmlDoc->createElement('Contact');

        $name = $xmlDoc->createElement('Name');
        $name->setAttribute('type', 'C');
        $name->appendChild($xmlDoc->createElement('First', $lead->getFirstname()));
        $name->appendChild($xmlDoc->createElement('Last', $lead->getLastname()));

        $names = $xmlDoc->createElement('Names');
        $names->appendChild($name);
        $root->appendChild($names);

        if ($lead->getAddress1()) {
            $address = $xmlDoc->createElement('Address');
            $address->setAttribute('score', '1');
            $address->appendChild($xmlDoc->createElement('Street', $lead->getAddress1()));
            $address->appendChild($xmlDoc->createElement('City', $lead->getCity()));
            $address->appendChild($xmlDoc->createElement('ST', $lead->getState()));
            $address->appendChild($xmlDoc->createElement('postal', $lead->getZipcode()));

            $addresses = $xmlDoc->createElement('Addresses');
            $addresses->appendChild($address);
            $root->appendChild($addresses);
        }

        $phone = preg_replace('/\D+/', '', $lead->getPhone());
        if (empty($phone)) {
            $phone = preg_replace('/\D+/', '', $lead->getMobile());
        }
        $phone = substr($phone, -10);
        if (10 === strlen($phone)) {
            $phone = $xmlDoc->createElement('Phone', $phone);
            $phone->setAttribute('score', '1');
            $phone->setAttribute('appends', 'validation,mobile,active');

            $phones = $xmlDoc->createElement('Phones');
            $phones->appendChild($phone);
            $root->appendChild($phones);
        }

        if ($lead->getEmail()) {
            $email = $xmlDoc->createElement('eMail', $lead->getEmail());
            $email->setAttribute('score', '1');

            $emails = $xmlDoc->createElement('eMailAddresses');
            $emails->appendChild($email);
            $root->appendChild($emails);
        }

        $xmlDoc->appendChild($root);

        return $xmlDoc->saveXML();
    }
@param Lead   $lead
@param string $serviceId

@return string