Enric Jaen writes: For example, having this: <AAA> <BBB/> <CCC/> <DDD/> </AAA> I'd like to return AAA with only BBB and CCC elements...
But what is the criterion that designated BBB and CCC? You could go by name: select="AAA|AAA/*[name()='BBB' or name()='CCC']" You could go by position: select="AAA|AAA/*[position() < 3]" Or if BBB and CCC had a certain attribute, you could test for it. In any case, this is a generic XPath question, so you could ask it on xsl-list or in comp.text.xml and get more answers. .................David Marston