inverse xpath not working
<p>Input XML:  </p>

<pre><code>&lt;Payheads&gt;
    &lt;Allowance&gt;
        &lt;Payhead&gt;
            &lt;type&gt;fixed&lt;/type&gt;
            &lt;code&gt;123&lt;/code&gt;
            &lt;name_en&gt;Chairman Allowance&lt;/name_en&gt;
            &lt;amount&gt;3000&lt;/amount&gt;
            &lt;source&gt;SalaryProfile/Allowances/Payhead/CHA/amount&lt;/source&gt;
        &lt;/Payhead&gt;
    &lt;/Allowance&gt;
    &lt;Deduction&gt;
        &lt;Payhead&gt;
            &lt;type&gt;Fixed&lt;/type&gt;
            &lt;code&gt;234&lt;/code&gt;
            &lt;name_en&gt;PF Subscription&lt;/name_en&gt;
            &lt;source&gt;SalaryProfile/Deductions/Payhead/amount&lt;/source&gt;
        &lt;/Payhead&gt;
    &lt;/Deduction&gt;
 &lt;/Payheads&gt;  
</code></pre>

<p>I want it to be like this:  </p>

<pre><code>&lt;Payheads&gt;
    &lt;Allowance&gt;
        &lt;Payhead&gt;
            &lt;code&gt;123&lt;/code&gt;
        &lt;/Payhead&gt;
    &lt;/Allowance&gt;
    &lt;Deduction&gt;
        &lt;Payhead&gt;
            &lt;code&gt;234&lt;/code&gt;
        &lt;/Payhead&gt;
    &lt;/Deduction&gt;
 &lt;/Payheads&gt;  
</code></pre>

<p>So I wrote an xpath expression:  </p>

<pre><code>SELECT DELETEXML(SALARY_PROFILE, '//Payhead/*[not(code)]') INTO RESULT_XML FROM DUAL;  
</code></pre>

<p>But it deletes everything under <code>Payhead</code> tag. If I remove <code>*</code> before <code>not</code> function then it raises error. How to solve this?</p>