title: Parsing XML in Android application using Ksoap2
body: <p>I have a web service which returns an XML file like this:</p>
  
  <pre><code>    &lt;Service&gt; 
         &lt;id&gt;12&lt;/id&gt; 
         &lt;function_code&gt;2&lt;/function_code&gt;  
         &lt;cf&gt;AABBBCCCAAA&lt;/cf&gt; 
         &lt;active&gt;0&lt;/active&gt; 
         &lt;option&gt;resume_state&lt;/option&gt; 
      &lt;/Service&gt; 
  </code></pre>
  
  <p>In many case the element  may be not returned, and the XML will be:</p>
  
  <pre><code>    &lt;Service&gt; 
         &lt;id&gt;12&lt;/id&gt; 
         &lt;function_code&gt;2&lt;/function_code&gt;  
         &lt;cf&gt;AABBBCCCAAA&lt;/cf&gt; 
         &lt;active&gt;0&lt;/active&gt; 
         &lt;option/&gt;
      &lt;/Service&gt; 
  </code></pre>
  
  <p>I'm parsing this element with the following code:</p>
  
  <pre><code>    String id = response.getProperty("cf").toString();
      String func= response.getProperty("function_code").toString();
      int active = Integer.parseInt(response.getProperty("active").toString();
      String option = response.getProperty("option").toString();
  </code></pre>
  
  <p>where response is SoapObject.</p>
  
  <p>In this situation, when I try to print the option String on error line:</p>
  
  <pre><code>    System.err.println("my option variable contains: "+option);
  </code></pre>
  
  <p>The result is:</p>
  
  <pre><code>    my option variable contains anyType{}
  </code></pre>
  
  <p>Why? And what can I do for parsing the option string obtaining null value if the option element is void () ?</p>