title: XML Literal with Linq statement
body: <p>I am going to be performing an XSLT transformation, transforming XML to an HTML table. It's tabular data, so that's why I'm not using div's. ;) </p>
  
  <p>Anyway, I need to repeat one part of the XSLT for the size of one of my collections. Here's a snippet of the code...</p>
  
  <pre><code>Dim styleSheet = &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
    xmlns:rh="ReportHub"
    exclude-result-prefixes="msxsl"
  &gt;
    &lt;xsl:output method="html" indent="yes" /&gt;
    &lt;xsl:template match="rh:Report/rh:Tablix1/rh:Details_Collection"&gt;
      &lt;xsl:variable name="alternating-row" select="position() mod 2" /&gt;
      &lt;table class=&lt;%= dataFormatter.formattingTableClass %&gt;&gt;
        &lt;xsl:choose&gt;
          &lt;xsl:when test="count(rh:Details)=0"&gt;
            &lt;tr&gt;
              &lt;td&gt;There are no items listed for this client&lt;/td&gt;
            &lt;/tr&gt;
          &lt;/xsl:when&gt;
          &lt;xsl:otherwise&gt;
            &lt;xsl:for-each select="rh:Details"&gt;
              &lt;tr class=&lt;%= dataFormatter.formattingTRClass %&gt;&gt;
                &lt;xsl:variable name="mainrow-position" select="position()" /&gt;
                &lt;xsl:for-each select="@*"&gt;
                  &lt;%= From x In dataFormatter.dataColumnSettings Select 
                    &lt;xsl:if test="name() != 'colName'"&gt;
                      &lt;xsl:choose&gt;
                        &lt;xsl:when test="$mainrow-position=1"&gt;
                          &lt;th&gt;
                            &lt;xsl:value-of select="name()"/&gt;
                          &lt;/th&gt;
                        &lt;/xsl:when&gt;
                        &lt;xsl:otherwise&gt;
                          &lt;td&gt;
                            &lt;xsl:value-of select="."/&gt;
                          &lt;/td&gt;
                        &lt;/xsl:otherwise&gt;
                      &lt;/xsl:choose&gt;
                    &lt;/xsl:if&gt; 
                  %&gt;
                &lt;/xsl:for-each&gt;
              &lt;/tr&gt;
            &lt;/xsl:for-each&gt;
          &lt;/xsl:otherwise&gt;
        &lt;/xsl:choose&gt;
      &lt;/table&gt;
    &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>The problem is that because the XML inside the LINQ query references the xsl namespace, I get:</p>
  
  <pre>
  Error   9   XML namespace prefix 'xsl' is not defined.
  </pre>
  
  <p>Anyone got any clever ideas?</p>
  
  <ul>
  <li>The inner workings of the XML inside the LINQ query isn't finished, so don't worry about what that looks like.</li>
  </ul>