Thanks for the supplementary information. It's much easier to offer help if you say why you're finding the problem difficult, rather than just offering a blank sheet of paper.
My suggestion in my previous answer addresses your first question. The template rule for <destination> uses the key() function to locate the element with the corresponding ID value, in this case a <zoo> element, and applies templates to it; if you have a template for <zoo> elements like this:
Code:
<xsl:template match="zoo">
<org id="{@id}" class="ZOO">
<text><xsl:value-of select="@name"/></text>
</org>
</xsl:template>
then you are most of the way there. The only thing this doesn't do is to generate the CityID attribute. To achieve that you need to add an <xsl:with-param name="cityID" select="../@id"/> parameter as a child of the apply-templates element, and then add <xsl:param name="cityID"/> to the zoo template, enabling you to output the attribute as CityID="{$cityID}".
The next stage is to generalize this. It seems that you want to treat zoo, museum, artmuseum etc in the same way. You can handle this with a generic template like this:
Code:
<xsl:template match="zoo|museum|artmuseum">
<xsl:param name="cityID"/>
<org id="{@id}" class="{upper-case(name())}" CityID="{$cityID}">
<text><xsl:value-of select="@name"/></text>
</org>
</xsl:template>
The function upper-case() is XSLT 2.0 only. If you're using 1.0 you need to write translate(name(), 'abcde...', 'ABCDE...').