title: RestXQ [XPTY0004] Cannot convert empty-sequence() to document-node()
body: <p>I have a RestXQ method:</p>
  
  <pre><code>declare
      %rest:path("/doSomething")
      %rest:POST
      %rest:form-param("name","{$name}")
      function page:doSomething($name as document-node())
      {
          (: Code... :)
      };
  </code></pre>
  
  <p>I tried to send a POST request to this method via XForms. As response on the client I get <code>[XPTY0004] Cannot convert empty-sequence() to document-node(): ().</code> I tried to remove <code>document-node()</code> but then the parameter $name is just empty. </p>
  
  <p>The request parameter looks like this: </p>
  
  <pre><code>&lt;data xmlns=""&gt;&lt;name&gt;Test&lt;/name&gt;&lt;/data&gt;
  </code></pre>
  
  <p>Any solutions?</p>