Q:

How to construct 3rd parameter of edai. Search method within CURL request to XPLAN API? 

I am trying to run a search on an API which requires my query data to be styled as XML nested in an XML request.   I'll post my entire class and method calls (which I sent to iress tech support) so that it can be fully reviewed and in the off-chance that anyone has access to the same API, they can instantly reproduce the issue for themselves. 
class XMLCurler
{
    private $username = '[redacted]';
    private $password = '[redacted]';
    private $url = 'https://[redacted].xplan.iress.com.au/RPC2/';
    public $ch;     // the curl handle
    public $token;  
    public $results;

    public function __construct() {
        if ($this->connect()) {
            if ($this->login()) {
                echo "<div class=\"success\">Successful Connection & Login.  Token: {$this->token}</div>";
            }
        }
    }

    public function __destruct() {
        if ($this->ch) {
            $this->disconnect();
        }
    }

    public function connect() {
        if (! $this->ch = curl_init($this->url)) { // generate curl handle
            echo "<div class=\"error\">CURL Error While Connecting (check url)";
            return false;
        }
        return true;
    }

    public function disconnect() {
        curl_close($this->ch);
    }

    public function processResponse($response) {
        if (! $response) {
            echo "<div class=\"error\">CURL Error While Attempting to Login - No XML token string<br><b>" , curl_error($this->ch) , "</b></div>";
            return false;
        }
        $decoded = xmlrpc_decode($response);
        if (is_array($decoded) && xmlrpc_is_fault($decoded)) {
            echo "<div class=\"error\">Error Response: {$decoded['faultString']} ({$decoded['faultCode']})</div>";
            return false;
        }
        return $decoded;    
    }

    public function login() {
        $postfields = xmlrpc_encode_request('edai. Login', array($this->username, $this->password));  // package as xml
        curl_setopt($this->ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
        curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($this->ch, CURLOPT_POSTFIELDS, $postfields);
        curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0);      // not advised, I need to find out how to avoid this
        curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0);      // not advised, I need to find out how to avoid this

        if (! $token = $this->processResponse(curl_exec($this->ch))) {
            return false;
        }
        if (! preg_match("~^[\w+]{20}$~", $token)) {
            echo "<div class=\"error\">Invalid/Unexpected Token Generated<br><b>$token</b>";
            return false;
        }
        $this->token = $token;  // cache the valid token
        return true;
    }

    public function listChildren($path) {
        $method = "edai. ListChildren";
        $request = xmlrpc_encode_request($method, array($this->token, $path));

        echo "<div class=\"notice\">XMLRPC Encoded Request (for $method): <pre>" , htmlentities($request) , "</pre></div>";

        curl_setopt($this->ch, CURLOPT_POSTFIELDS, $request);       
        if (! $results = $this->processResponse(curl_exec($this->ch))) {
            return false;
        }
        $this->results = $results;  // cache the valid results
        return true;
    }

    public function search($basepath, $queryxml) {
        $method = "edai. Search";

        /** Desperate/Manual xml construction ...
         * $xml = new DOMDocument("1.0", "utf-8");
         * $xml->appendChild($methodCall = $xml->createElement("methodCall"));
         * $methodCall->appendChild($methodName = $xml->createElement("methodName"));
         * $methodCall->appendChild($params = $xml->createElement("params"));

         * $params->appendChild($param1 = $xml->createElement("param"));
         * $param1->appendChild($value1 = $xml->createElement("value"));
         * $value1->appendChild($string1 = $xml->createElement("string"));

         * $params->appendChild($param2 = $xml->createElement("param"));
         * $param2->appendChild($value2 = $xml->createElement("value"));
         * $value2->appendChild($string2 = $xml->createElement("string"));

         * $params->appendChild($param3 = $xml->createElement("param"));
         * $param3->appendChild($value3 = $xml->createElement("value"));
         * $value3->appendChild($string3 = $xml->createElement("string"));
         * $string3->appendChild($EntitySearch = $xml->createElement("EntitySearch"));
         * $EntitySearch->appendChild($SearchResult1 = $xml->createElement("SearchResult"));
         * $SearchResult1->setAttribute("field", "first_name");

         * $EntitySearch->appendChild($SearchResult2 = $xml->createElement("SearchResult"));
         * $SearchResult2->setAttribute('field', "last_name");

         * $EntitySearch->appendChild($SearchQuick = $xml->createElement("SearchQuick"));
         * $SearchQuick->appendChild($s = $xml->createElement("s"));

         * $xpath = new DOMXPath($xml);
         * $result1 = $xpath->query("//methodName");
         * $result1->item(0)->nodeValue = $method;

         * $result2 = $xpath->query("//params/param[1]/value/string");
         * $result2->item(0)->nodeValue = $this->token;
         * $result3 = $xpath->query("//params/param[2]/value/string");
         * $result3->item(0)->nodeValue = "entitymgr/client";

         * $result4 = $xpath->query("//SearchQuick/s");
         * $result4->item(0)->nodeValue = "last_name:Smith";

         * $xml->formatOutput = true;
         * $request = $xml->saveXML();
         */

         /** Desperately attempted passing array ...
          * $queryarray = array(
          *     "EntitySearch" => array(
          *         array(
          *             "SearchResult" => array(
          *                 "@attr" => array(
          *             "field" => "first_name"
          *                 )
          *             )
          *         ),
          *             array(
          *             "SearchResult" => array(
          *                 "@attr" => array(
          *                     "field" => "last_name"
          *                 )
          *             )
          *         ),
          *         array(
          *             "SearchQuick" => array(
          *                 "s" => "last_name:Smith"
          *             )
          *         )
          *     )
          * );
          */

        $request = xmlrpc_encode_request($method, array($this->token, $basepath, $queryxml));  // this mutates the nested $queryxml string
            // Causes:
                //Error Response: UNKNOWN(CORBA.UNKNOWN(omniORB.UNKNOWN_PythonException, CORBA.COMPLETED_MAYBE)) (-32505)
        //$request = html_entity_decode($request);  // repair encoded entities
        //$request = preg_replace('~(?:>\K\s+)|(?:\s+(?=<))~', '', $request);  // strip every whitespace character between tags (hack)
            // Causes:
                // Error Response: ExpatError(syntax error: line 1, column 0 (byte 0)) (-32505)
        echo "<div class=\"notice\">XMLRPC Encoded Request (for $method): <pre>" , htmlentities($request) , "</pre></div>";

        curl_setopt($this->ch, CURLOPT_POSTFIELDS, $request);
        if (! $results = $this->processResponse(curl_exec($this->ch))) {
            return false;
        }
        $this->results = $results;  // cache the valid results
        return true;
    }
}

Below is how I make the calls.   edai. ListChildren works because I don't have to send any XML data.   edai. Search does not work because I am failing to properly prepare the XML query within the XML request. 
$XC = new XMLCurler();

/* edai. ListChildren works as desired/expected */
$path = "/entitymgr/client";
if ($XC->listChildren($path)) {
    echo "<div>List of Children Successful.<pre>";
    var_export($XC->results);
    echo "</pre></div>";
}

/* edai. Search does not work */
$basepath = "entitymgr/client";
$queryxml = <<<XML
<EntitySearch>
 <SearchResult field="first_name"/>
 <SearchResult field="last_name"/>
 <SearchQuick><s>last_name:Smith</s></SearchQuick>
</EntitySearch>
XML;
if ($XC->search($basepath, $queryxml)) {
    echo "<div>Search Successful.<pre>";
    var_export($XC->results);
    echo "</pre></div>";
}

This is the attempted request and error message. 
This is the relevant portion of the manual I was provided (XPLAN XML-RPC EXTERNAL DATA ACCESS INTERFACE 7 May 2013):
I have contacted iress.com a couple of weeks ago, they called me to loosely confirm that I was authorized to access the API, and told me that they'd be in touch -- that follow up call hasn't happened and I would like to get back to work on this project. 
I do know for a fact that there is a last name of Smith to match my query. 
I have no Python experience so the error responses are no help to me.   I have made more hail mary attempts than I have posted, but I am tired of wasting my time.   I don't know if the third parameter is meant to be nested inside of a <value>, <param>, <struct>, <string>, <array>, <xml>, or something else entirely. 
If anyone has any suggestions regarding how to prepare my XML query for the request, I'll run them and supply feedback. 
I am also happy to receive advice on the class design, security concerns, and completely different php approaches for getting the edai. Search to return some useful data. 

As requested by @ThW, here is a collection of xml attempts and their respective error responses: https://pastebin.com/dYtwXWxz

A:

It turns out that the error was not in my php code (which I have since developed further to better handle the response data), but rather the xml query that I was sending. 
Instead of using what the documentation suggested:
<SearchQuick><s>last_name:Smith</s></SearchQuick>

Use the following equivalent valid expression:
<SearchByField field="last_name" op="equal"><s>Smith</s></SearchByField>

