title: XPath 3.0 XML parsing functions in XSLT
body: <p>I have a sequence of strings that I need to parse as XML using XSLT. For example:</p>
  
  <p><code>&amp;lt;span&amp;gt;Foo&amp;lt;/span&amp;gt; &amp;amp; &amp;lt;span&amp;gt;bar&amp;lt;/span&amp;gt; have been tagged.</code></p>
  
  <p>When I try to parse this using fn:parse-xml-fragment (using Saxon-PE 9.6.0.5), two errors are thrown:</p>
  
  <ol>
  <li>The entity name must immediately follow the '&amp;' in the entity reference.</li>
  <li>FODC0006: First argument to parse-xml-fragment() is not a well-formed and namespace-well-formed XML fragment.</li>
  </ol>
  
  <p>If I remove the <code>&amp;amp;</code> entity from the input text, then it parses correctly. However, if the entity is escaped in the input, why would it cause XML parsing to fail?</p>