Here is the XML:
<recordTarget>
<patientRole>
<patient>
<religiousAffiliationCode code="1013" displayName="Christian (non-Catholic, non-specific)" codeSystem="2.16.840.1.113883.5.1076" codeSystemName="HL7 Religious Affiliation"/>
</patient>
</patientRole>
</recordTarget>
Here is my xpath statement (n1 is namespace)
<xsl:variable name="religion" select="n1:recordTarget/n1:patientRole/n1:patient/n1:religiousAffilliationCode/@displayName"/>