<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.head.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.head</api:function-name><api:suggest>fn.head</api:suggest><api:suggest>fn</api:suggest><api:suggest>head</api:suggest><api:function-link mode="xquery" fullname="fn:head">/apidoc/8.0/fn:head.xml</api:function-link><api:function mode="javascript" name="head" type="builtin" lib="fn" category="Higher-Order" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.head"><api:summary>
  Returns the first item in a sequence.
  For more details, see
  <a href="http://www.w3.org/TR/2011/WD-xpath-functions-30-20111213/#func-head" target="_blank" xmlns="http://www.w3.org/1999/xhtml">XPath 3.0 Functions and Operators</a>.
</api:summary><api:params><api:param name="seq" type="item()*" class="javascript"><api:param-description>
    The function value.
  </api:param-description><api:param-name>seq</api:param-name><api:param-type>ValueIterator</api:param-type></api:param><api:param name="arg" type="ValueIterator" class="javascript"><api:param-description>
  A sequence of function values (as a ValueIterator).  If you pass in a 
  single value, 
  it is treated as a ValueIterator with that single item; therefore, if you 
  pass in an array, the function will return the array. 
  If you mean to check the values of each item in the array, then
  you can call <a href="./xdmp.arrayValues" xmlns="http://www.w3.org/1999/xhtml"><code>xdmp.arrayValues</code></a> 
  on the array. 
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>ValueIterator</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.head(xdmp.arrayValues([1,2,3]))
=&gt; 1
</pre></api:example></api:function></api:function-page>