Your subject line says you're having problems with for-each but the body of the message doesn't say what your problems are, so it's hard to help you with them. You've written your pseudo-code as a fill-in-the-blanks stylesheet, so that's the way I would code it:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet ...>
<xsl:template match="/"
<response>
<header>
<rtnCode></rtnCode>
<rtnMsg></rtnMsg>
</header>
<txnInfo>
<buyPpbRate1><xsl:value-of select="/response/transaction[@type=" FXIB"]/ppbExchanegRate1"/></buyPpbRate1>
<buyPpbRate2>xsl:value-of select="/response/transaction[@type=" FXIB"]/ppbExchanegRate2"/></buyPpbRate2>
<sellPpbRate1> etc</sellPpbRate1>
<sellPpbRate2>etc</sellPpbRate2>
</txnInfo>
</response>
</xsl:template>
</xsl:stylesheet>
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference