title: XQuery file returning invalid entity reference using special characters
body: <p>I have the following query in a MarkLogic XQuery file, and I am seeing the following error message returned</p>
  
  <pre><code>XDMP-ENTITYREF: (err:XPST0003) Invalid entity reference " " . See the MarkLogic server error log for further detail.
  </code></pre>
  
  <p>The following is the code I am using in the XQuery file.</p>
  
  <pre><code>xquery version "1.0-ml";
  
  declare variable $query := 
  
    cts:or-query
    ((
      cts:element-word-query(xs:QName("lines"),"l&amp;amp;l"),
      cts:element-word-query(xs:QName("lines"),"pool &amp;amp; cue"),
      cts:element-word-query(xs:QName("lines"),"look")
    ));
  
  declare function local:do-query(){
    element xml {
      for $i in cts:uris( (), (), $query)
      let $item := doc($i)
  
      return
        element item {
          element title { $item/title/string() }
      }
    }
  };
  
  local:do-query()
  </code></pre>
  
  <p>Obviously the 2x tags i am looking for are <code>l&amp;l</code> and <code>pool &amp; cue</code>. I have also looked into the repair-full suggestion in another question posted, but couldn't figure out how that fits into this query. If I removed the ones with special characters, it works as expected.</p>
  
  <p>Any ideas?</p>