i want to remove the parent tag , if the tag has only note tag in it.
Example :
Input:
<data>
<subdata>
<l1item>
    <note>
        <para>hello
        </para>
    </note>
</l1item>
</subdata>
<subdata>
<l2item>
    <para> dont delete 
    </para>
</l2item>
<l3item>
    <note>
        <para>hello
        </para>
    </note>
    <para> dont delete 
    </para>
</l3item>
</subdata>
</data>
Expected Output:
<data>
<subdata>
<note>
<para>hello
</para>
</note>
</subdata>
<subdata>
<l2item>
<para> dont delete 
</para>
</l2item>
<l3item>
    <note>
        <para>hello
        </para>
    </note>
    <para> dont delete 
    </para>
</l3item>
</subdata>
</data>
In the above example the l1item tag is deleted has it has only note tag in it , l2item is not deleted as it has para tag and l3item is not deleted as it has note tag and para tag
so my requirement is like i want to delete the l1item or l2item or l3item if it has only note tag in it , and if it has some other tag or note tag with some other tag that should not be deleted.
 
    