You don't say how you want to process the data when you find it, but the simplest approach is to do
<xsl:apply-templates/>
from within the match="header" template, and then write template rules for
<xsl:template match="header/error">
<xsl:template match="detail">
<xsl:template match="detail/error">
in each case calling xsl:apply-templates to process any children.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference