I have a xml file
<category>
<type name="SWEATERS">
<product id =1>
<itemNumber>1</itemNumber>
<name>ProductA2</name>
<price>345</price>
</product>
<product id=2>
<itemNumber>4</itemNumber>
<name>Product Test </name>
<price>456</price>
</product>
</type>
</category>
I used the xquery
$xml->xpath('//category/type/product[@id=1]');
When i used this xquery iam getting only the name and price.How i can get the type name 'SWEATERS' along with name and price