FADE
PHP код:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:param name="tyle"/>
<xsl:template match="/">
<div>
<xsl:apply-templates select="//mypear/id"/>
</div>
</xsl:template>
<xsl:template match="mypear/id">
<xsl:variable name="id" select="text()"/>
<input type="checkbox" id="{text()}" value="{text()}">
<xsl:if test="//node()[name() = $type]/check/id[text() = $id]">
<xsl:attribute name="checked">checked</xsl:attribute>
</xsl:if>
</input>
</xsl:template>
</xsl:stylesheet>
если я правильно понял то вот этот шаблон сделает примерно то что вам нужно...