If you'll excuse me plugging my own technology, this is something that becomes much easier with a schema-aware XSLT or XQuery processor such as Saxon-SA (
www.saxonica.com). For example, in XSLT 2.0 you can do:
<xsl:import-schema namespace="..."/>
<xsl:copy-of select="some/path/expression" validation="strict"/>
or alternatively
<xsl:copy-of select="some/path/expression" type="xyz:addressType"/>
Michael Kay
Michael Kay
http://saxon.sf.net/