You can set the variable this way:
<xsl:variable name="variableName" select="//h:fruit[h:p1='Orange']/h:p2"/>
That finds the matching fruit element and returns the content of its p2 child. You will need add the definition for the h: namespace prefix.