I need to take in 1 .XML file, and output N files that are a sub-set of the input file. This sub-set is based on a predicate check of 2 nodes. My plan is to run the input file over a XSLT template N times to output each file.My input looks like this:\[code\]<employee_data><employees> <employee id="1"> <first_name>2sk8d</first_name> <agency_code>38</agency_code> <offices_administered> <office_administered office_identifier="ALLPOIs" agency_code="HL" /> </offices_administered> </employee> <employee id="2"> <first_name>2sk8d</first_name> <agency_code>24</agency_code> <offices_administered> <office_administered office_identifier="ALLPOIs" agency_code="22" /> </offices_administered> </employee> <employee id="3"> <first_name>2sk8d</first_name> <agency_code>22</agency_code> <offices_administered> <office_administered office_identifier="ALLPOIs" agency_code="HL" /> </offices_administered> </employee> </employees>\[/code\]My XSLT looks like this\[code\]<?xml version="1.0" encoding="utf-8"?>\[/code\]\[code\]<xslutput method="xml" indent="yes" encoding="utf-16"/> <xsl:template match="/employee_data/employees/employee[agency_code='22' or offices_administered/office_administered/@agency_code='22']"> <xsl:copy> <xsl:copy-of select="."/> <xsl:apply-templates/> </xsl:copy> </xsl:template><xsl:template match="@* | node()"> <xsl:message terminate="no"> Catch 1 <xsl:value-of select="name()"/> </xsl:message></xsl:template> \[/code\]My problem is that my output does not contain the EmployeeData or Employees root/parent nodes.If I change my xslt to put in the first xsl:template-match, then those tags are repeated multiple times/If I change my match predicate to /employee_data/employees[employee/agency_code='22' or employee/offices_administered/office_administered/@agency_code='22'] then I get all employees.It's almost like I want some magic to wrap my whole output of the match up in my two parent tags.