I have an xml like below
<PO>
<ITEM>
<ID>1000</ID>
<PRICE>10</PRICE>
</ITEM>
<ITEM>
<ID>1000</ID>
<PRICE>10</PRICE>
</ITEM>
<ITEM>
<ID>1001</ID>
<PRICE>10</PRICE>
</ITEM>
<ITEM>
<ID>1001</ID>
<PRICE>10</PRICE>
</ITEM>
</PO>
I want an xpath that will get only ID = 1000 and the output should be like below
<PO>
<ITEM>
<ID>1000</ID>
<PRICE>10</PRICE>
</ITEM>
<ITEM>
<ID>1000</ID>
<PRICE>10</PRICE>
</ITEM>
</PO>
I tried /PO/ITEM[ID="1000"] but it gives the following but I need even the root "PO" also...
<ITEM>
<ID>1000</ID>
<PRICE>10</PRICE>
</ITEM>
<ITEM>
<ID>1000</ID>
<PRICE>10</PRICE>
</ITEM>
Thanks for the help