I assume you want to select the doc
node based on its children? If so, given your above xml sample , you would have to create an xpath which selects doc
based on two predicates (which each have a predicate of their own. It might look something like this:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:copy-of select="response/result/doc[int[@name='objecttype'] = '5' and int[@name='objectid'] = '2']" />
</xsl:template>
</xsl:stylesheet>
I've tested this locally and the output is:
<doc>
<str name="title">Tours</str>
<int name="objecttype">5</int>
<str name="friendlyurl">tours</str>
<str name="avatar">2_156_DSC01511.JPG</str>
<int name="objectid">2</int>
</doc>