title: Converting HTML to XML using XSLT
body: <p>I'm trying to convert an XHTML document to XML using XSLT but I'm currently having trouble getting my templates to match the tags in the input document. Should I be able to convert XHTML to XML like this? If so is there an error in my stylesheet?</p>
  
  <p><strong>Input Document:</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"&gt;
      &lt;head&gt;      
          &lt;title&gt;title text&lt;/title&gt;       
      &lt;/head&gt;
      &lt;body&gt;      
          &lt;p&gt;body text&lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Stylesheet:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
      &lt;xsl:output method="xml" indent="yes" /&gt;
  
  
      &lt;xsl:template match="/"&gt; 
      &lt;article&gt;       
          &lt;xsl:apply-templates select="html/head"&gt;&lt;/xsl:apply-templates&gt;
      &lt;/article&gt;
      &lt;/xsl:template&gt;
  
  
  
      &lt;xsl:template match="html/head"&gt;
          &lt;head&gt;&lt;xsl:text&gt;This is where all the metadata will come from&lt;/xsl:text&gt;&lt;/head&gt;
      &lt;/xsl:template&gt; 
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p><strong>Expected Output</strong> </p>
  
  <pre><code>&lt;article&gt;       
    &lt;head&gt;This is where all the metadata will come from&lt;/head&gt;        
  &lt;/article&gt;
  </code></pre>
  
  <p>Thanks</p>