Using XPath's text() function

The XML file:

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <textarea name="123">a</textarea>
  <textarea name="123">b</textarea>
  <textarea name="123">a</textarea>
  <textarea name="123">c</textarea>
  <textarea name="555">a</textarea>
</root>

The XSL below shows how to use text() in XPath:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="text" encoding="UTF-8" />
 
  <xsl:template match="/">
    <xsl:for-each select="//textarea[@name='123' and text()='a']">
      <xsl:text>I found my XPath.&#xa;</xsl:text>
    </xsl:for-each>
  </xsl:template>
 
</xsl:stylesheet>