Get attribute value from xml by checking conditions
<p>Following is my xml from where I have to get attribute value:</p>

<pre><code> &lt;R a="1" b="2"&gt;
&lt;I attribute1="" attribute2="some text"/&gt;
&lt;I attribute1="" attribute2="some text"/&gt;
&lt;I attribute1="0" attribute2="some text"/&gt;
&lt;I attribute1="0" attribute2="some text"/&gt;
&lt;/R&gt;
</code></pre>

<p>Here I've to check if <code>attribute1</code> is not null then I've to get value of <code>attribute2</code> from <code>I</code> tag.How to do this???
Please help...</p>
