Have a look at the product.variantsinrightbar.xml.config xmlpackage. In the <xsl:template match="/"> section we do an <xsl:choose> that tests whether there are multiple variants or only one variant and then do something different based on what we find. Should be really close to what you're trying to do. If you're unsure about the xml structure that is being used to determine that, set debug="true" at the top of the xmlpackage and refresh the page using that xmlpackage; you'll get the full xml structure dumped on the page as well as a copy of that xml in the images directory of your site.
<a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>