Dezerialize XML where xml inside node can be represented as plain Text or as an object
<p>sirs, I have a case, when I</p>

<ol>
<li>Make http request to rest resource </li>
<li>Get xml response</li>
<li>Understand what deserialized response is</li>
</ol>

<p>I have generic method T Post(string uri, string body) that "knocking" to rest service and getting different responses on the same url and request format, for example</p>

<p>In one case I`m getting</p>

<pre><code>&lt;response&gt;
    &lt;status&gt;OK&lt;/status&gt;
    &lt;statusCode&gt;0&lt;/statusCode&gt;
    &lt;result&gt;Sample response message here&lt;/result&gt;
&lt;/response&gt;
</code></pre>

<p>In another case I`m getting</p>

<pre><code> &lt;response&gt;
        &lt;status&gt;OK&lt;/status&gt;
        &lt;statusCode&gt;0&lt;/statusCode&gt;
        &lt;result&gt;
    &lt;SampleEntityOne&gt;Entity1 value&lt;/SampleEntityOne&gt;
    &lt;SampleEntityTwo&gt;Entity2 value&lt;/SampleEntityTwo&gt;
    ...
    &lt;SampleEntityN&gt;EntityN value&lt;/SampleEntityN&gt;
        &lt;/result&gt;
    &lt;/response&gt;
</code></pre>

<p>So, how can I use something common when creating class that can be deserialized using <code>XmlSerializer</code> or <code>DataContractSerializer</code>?</p>

<p>Thanks</p>