title: Getting the XML as string for a SoapVar variable - without a webservice (locally)?
body: <p>Consider this simple snippet of code:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  # http://php.net/manual/en/soapvar.soapvar.php
  
  $parm = array();
  $parm[] = new SoapVar('123', XSD_STRING, null, null, 'customerNo' );
  $parm[] = new SoapVar('THIS', XSD_STRING, null, null, 'selection' );
  $parm[] = new SoapVar('THAT', XSD_STRING, null, null, 'selection' );
  $out = new SoapVar($parm, SOAP_ENC_OBJECT);
  
  var_dump($out);
  ?&gt;
  </code></pre>
  
  <p>On the thread it is taken from, it is claimed that it would produce something like the following XML:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;customerNo&gt;123&lt;/customerNo&gt;
  &lt;selection&gt;THIS&lt;/selection&gt;
  &lt;selection&gt;THAT&lt;/selection&gt;
  </code></pre>
  
  <p>... however, only thing I can see with <code>var_dump()</code> is something like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>object(SoapVar)#4 (2) {
    ["enc_type"]=&gt;
    int(301)
    ["enc_value"]=&gt;
    array(3) {
      [0]=&gt;
      object(SoapVar)#1 (3) {
        ["enc_type"]=&gt;
        int(101)
        ["enc_value"]=&gt;
        string(3) "123"
        ["enc_name"]=&gt;
        string(10) "customerNo"
      }
      [1]=&gt; ...
  </code></pre>
  
  <p>How could I get the expected XML of a SoapVar object, without calling an actual remote webservice?</p>