<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="no" encoding="utf-8"/>
<xsl:template match="/">
<Root>
<xsl:for-each select="/Root/ParentNode">
<xsl:if test="count(ChildNode) < 1 or ChildNode/@printParentNode = 'yes'">
<ParentNode id="{@id}"><xsl:apply-templates/></ParentNode>
</xsl:if>
</xsl:for-each>
</Root>
</xsl:template>
</xsl:stylesheet>