This page was generated
September  12,  2012
5:59  AM
XQuery & XSLT Built-In & Modules Function Reference

Built-In: Extension - Extension Functions

The extension functions provide miscellaneous extensions to XQuery.

Function Summary
xdmp:add64 Add two 64-bit integer values, discarding overflow.
xdmp:and64 AND two 64-bit integer values.
xdmp:base64-decode Converts base64-encoded string to plaintext.
xdmp:base64-encode Converts plaintext into base64-encoded string.
xdmp:binary-decode Converts an encoded byte sequence, passed in as a binary node, from the specified encoding to a unicode string.
xdmp:castable-as Returns true if a value is castable.
xdmp:crypt Calculates the password hash for the given password and salt.
xdmp:document-get-collections Returns the collections to which a given document belongs.
xdmp:element-content-type Returns the schema-defined content-type of an element ("empty", "simple", "element-only", or "mixed").
xdmp:email Send an email in an XQuery program.
xdmp:encoding-language-detect Analyzes binary, text, or XML data and suggests possible pairs of encoding and language, with a confidence score for each pair.
xdmp:group Returns the the ID of the group specified in the parameter.
xdmp:hash32 Returns the 32-bit hash of a string.
xdmp:hash64 Returns the 64-bit hash of a string.
xdmp:hex-to-integer Parses a hexadecimal string, returning an integer.
xdmp:integer-to-hex Returns a hexadecimal representation of an integer.
xdmp:integer-to-octal Returns an octal representation of an integer.
xdmp:key-from-QName Construct a context-independent string from a QName.
xdmp:lshift64 Left-shift a 64-bit integer value.
xdmp:md5 Calculates the md5 hash of the given argument.
xdmp:mul64 Muliply two 64-bit integer values, discarding overflow.
xdmp:node-kind Returns an xs:string representing the node's kind: either "document", "element", "attribute", "text", "namespace", "processing-instruction", "binary", or "comment".
xdmp:not64 NOT a 64-bit integer value.
xdmp:octal-to-integer Parses an octal string, returning an integer.
xdmp:or64 OR two 64-bit integer values.
xdmp:parse-dateTime Parses a string containing date, time or dateTime using the supplied picture argument and returns a dateTime value.
xdmp:parse-yymmdd Parses a string containing date, time or dateTime using the supplied picture argument and returns a dateTime value.
xdmp:QName-from-key Construct a QName from a string of the form "{namespaceURI}localname".
xdmp:random Returns a random unsigned integer between 0 and a number up to 64 bits long.
xdmp:rshift64 Right-shift a 64-bit integer value.
xdmp:sleep Delays for a specific amount of time.
xdmp:step64 Combines an initial hash with a subsequent hash.
xdmp:strftime Formats a dateTime value using POSIX strftime.
xdmp:user-last-login Returns the last-login node for the specified user ID.
xdmp:xor64 XOR two 64-bit integer values.
Function Detail
xdmp:add64(
$x as xs:unsignedLong,
$y as xs:unsignedLong
)  as   xs:unsignedLong
Summary:

Add two 64-bit integer values, discarding overflow.

Parameters:
$x : The first value.
$y : The second value.

Example:
  xdmp:add64(11442580934957149475,14565934789622151058)
  => 7561771650869748917

xdmp:and64(
$x as xs:unsignedLong,
$y as xs:unsignedLong
)  as   xs:unsignedLong
Summary:

AND two 64-bit integer values.

Parameters:
$x : The first value.
$y : The second value.

Example:
  xdmp:and64(255, 2)
   => 2

xdmp:base64-decode(
$encoded as xs:string
)  as   xs:string
Summary:

Converts base64-encoded string to plaintext.

Parameters:
$encoded : Encoded text to be decoded.

Example:
xdmp:base64-decode(
     "c2xpbmdzIGFuZCBhcnJvd3Mgb2Ygb3V0cmFnZW91cyBmb3J0dW5l")
=> slings and arrows of outrageous fortune

xdmp:base64-encode(
$plaintext as xs:string
)  as   xs:string
Summary:

Converts plaintext into base64-encoded string.

Parameters:
$plaintext : Plaintext to be encoded.

Example:
  xdmp:base64-encode("slings and arrows of outrageous fortune")
   => c2xpbmdzIGFuZCBhcnJvd3Mgb2Ygb3V0cmFnZW91cyBmb3J0dW5l

xdmp:binary-decode(
$encoded as node(),
$encoding-name as xs:string
)  as   xs:string
Summary:

Converts an encoded byte sequence, passed in as a binary node, from the specified encoding to a unicode string.

Parameters:
$encoded : A binary node containing the encoded stream.
$encoding-name : Specifies the encoding to use when decoding the document. Supported values include UTF-8 and ISO-8859-1. The string specifed for the encoding option will be matched to a registered encoding name using the Unicode Charset Alias Matching rules (http://www.unicode.org/reports/tr22/#Charset_Alias_Matching).

Example:
xdmp:binary-decode(
   fn:doc("binary_doc_encoded_as_ShiftJIS.dat")/node(),
          "sjis")
=> contents of document after decoding, in unicode characters

xdmp:castable-as(
$namespace-uri as xs:string,
$local-name as xs:string,
$item as item()
)  as   xs:boolean
Summary:

Returns true if a value is castable. This is similar to the "castable as" XQuery predicate, except that the type is determined at runtime.

Parameters:
$namespace-uri : The namespace URI of the type.
$local-name : The local-name of the type.
$item : The item to be cast.

Example:
  xdmp:castable-as(
    "http://www.w3.org/2001/XMLSchema",
    "integer",
    "12")
    => true()

xdmp:crypt(
$password as xs:string,
$salt as xs:string
)  as   xs:string
Summary:

Calculates the password hash for the given password and salt.

Parameters:
$password : String to be hashed.
$salt : Salt to avoid 1:1 mapping from passwords to hashes. Only the first 8 characters of the salt are significant; any characters beyond the eighth are ignored.

Usage Notes:

You typically use the username as the salt, which ensures that no two hash values will be the same, even if different users have the same password.


Example:
  xdmp:crypt("123abc","admin")
  => "arQEnpM6JHR8vY4n3e5gr0"
 

xdmp:document-get-collections(
$uri as xs:string
)  as   xs:string*
Summary:

Returns the collections to which a given document belongs.

Parameters:
$uri : The document URI.

Example:
  xdmp:document-get-collections("chapter5.xml")
  =>("http://marklogic.com/all-books", 
        "http://marklogic.com/xml-books")

xdmp:element-content-type(
$element as element()
)  as   xs:string
Summary:

Returns the schema-defined content-type of an element ("empty", "simple", "element-only", or "mixed").

Parameters:
$element : An element node.

Example:
  xdmp:element-content-type(<html xmlns="http://www.w3.org/1999/xhtml"/>)
  => "element-only"

xdmp:email(
$message as node()
)  as   empty-sequence()
Summary:

Send an email in an XQuery program. A valid SMTP Relay must be configured in the Groups page of the Admin Interface for the email to be sent. The format of the email message must be an XML file that complies with the schema files listed below.

Parameters:
$message : An XML representation of an email message to send. The message must comply with the XML schemas defined in the following schema files:
  • install_dir/Config/email-xml.xsd
  • install_dir/Config/rfc822.xsd
where install_dir is the directory in which MarkLogic Server is installed.

Required Privilege:

http://marklogic.com/xdmp/privileges/xdmp-email

Example:
This example demonstrates sending a message with 
HTML content.
   
xdmp:email(
<em:Message 
 xmlns:em="URN:ietf:params:email-xml:" 
 xmlns:rf="URN:ietf:params:rfc822:">
  <rf:subject>Sample HTML Email</rf:subject>
  <rf:from>
    <em:Address>
      <em:name>MarkLogic</em:name>
      <em:adrs>marklogic@yourdomain</em:adrs>
    </em:Address>
  </rf:from>
  <rf:to>
    <em:Address>
      <em:name>System Administrator</em:name>
      <em:adrs>admin@yourdomain</em:adrs>
    </em:Address>
  </rf:to>
  <em:content>
    <html xmlns="http://www.w3.org/1999/xhtml"> 
      <head>
        <title>Test HTML message</title>
      </head>
      <body>
        <h1>Test HTML message</h1>
        <p>Here is a simple paragraph</p>
      </body> 
    </html>
  </em:content>
</em:Message>)

Example:
This example demonstrate sending a message with 
plain text content. 

xdmp:email(
<em:Message 
 xmlns:em="URN:ietf:params:email-xml:" 
 xmlns:rf="URN:ietf:params:rfc822:">
  <rf:subject>Sample Plain Text Email</rf:subject>
  <rf:from>
    <em:Address>
      <em:name>MarkLogic</em:name>
      <em:adrs>marklogic@yourdomain</em:adrs>
    </em:Address>
  </rf:from>
  <rf:to>
    <em:Address>
      <em:name>System Administrator</em:name>
      <em:adrs>admin@yourdomain</em:adrs>
    </em:Address>
  </rf:to>
  <em:content xml:space="preserve">
This is a sample email with a plain text body.
</em:content>
</em:Message>)


xdmp:encoding-language-detect(
$document as node()
)  as   element()*
Summary:

Analyzes binary, text, or XML data and suggests possible pairs of encoding and language, with a confidence score for each pair. Scores of 10 and above are high confidence recommendations. The results are given in order of decreasing score. Accuracy may be poor for short documents.

Parameters:
$document : Node to be analyzed for possible encodings and languages. If the node is an XML element or document node, the function takes the string value of the specified node (equivalent of fn:string($node)) to detect the encoding and language.

Usage Notes:

If the input is very small (for example, less than two words), then xdmp:encoding-language-detect returns the empty sequence.

For best results, the input should be at least several hundred bytes.


Example:
xdmp:encoding-language-detect(xdmp:document-get("/tmp/unknown.dat"))
=>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>en</language>
  <score>9.834</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>it</language>
  <score>8.976</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1250</encoding>
  <language>sl</language>
  <score>8.265</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1250</encoding>
  <language>ro</language>
  <score>7.975</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>fr</language>
  <score>7.933</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>da</language>
  <score>7.656</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>nb</language>
  <score>7.603</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>nl</language>
  <score>7.331</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>es</language>
  <score>7.167</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>ca</language>
  <score>7.143</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>de</language>
  <score>6.605</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1250</encoding>
  <language>sr</language>
  <score>6.595</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1250</encoding>
  <language>sk</language>
  <score>6.455</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1250</encoding>
  <language>cs</language>
  <score>6.438</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>nn</language>
  <score>6.337</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>sv</language>
  <score>5.827</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>pt</language>
  <score>5.762</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1250</encoding>
  <language>hu</language>
  <score>5.356</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1250</encoding>
  <language>hr</language>
  <score>4.941</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1250</encoding>
  <language>pl</language>
  <score>4.693</score>
</encoding-language>
<encoding-language xmlns="xdmp:encoding-language-detect">
  <encoding>windows-1252</encoding>
  <language>fi</language>
  <score>3.885</score>
</encoding-language>

xdmp:group(
[$name as xs:string]
)  as   xs:unsignedLong
Summary:

Returns the the ID of the group specified in the parameter. Returns the ID of the current group if no parameter is specified.

Parameters:
$name (optional): The name of the group. The default value is the name of the group the current host belongs to.

Example:
  xdmp:group("Default")
  => 134722342511344334243

xdmp:hash32(
$string as xs:string
)  as   xs:unsignedInt
Summary:

Returns the 32-bit hash of a string.

Parameters:
$string : The string to be hashed.

Example:
  xdmp:hash32("/a/b[1]/c")
  => 152930691

xdmp:hash64(
$string as xs:string
)  as   xs:unsignedLong
Summary:

Returns the 64-bit hash of a string.

Parameters:
$string : The string to be hashed.

Example:
  xdmp:hash64("/a/b[1]/c")
  => 5082244643751628547

xdmp:hex-to-integer(
$hex as xs:string
)  as   xs:integer
Summary:

Parses a hexadecimal string, returning an integer.

Parameters:
$hex : The hexadecimal string.

Example:
  xdmp:hex-to-integer("1234567890abcdef")
   => 1311768467294899695

xdmp:integer-to-hex(
$val as xs:integer
)  as   xs:string
Summary:

Returns a hexadecimal representation of an integer.

Parameters:
$val : The integer value.

Example:
  xdmp:integer-to-hex(1234567890)
   => "499602d2"

xdmp:integer-to-octal(
$val as xs:integer
)  as   xs:string
Summary:

Returns an octal representation of an integer.

Parameters:
$val : The integer value.

Example:
  xdmp:integer-to-octal(1234567890)
   => "11145401322"

xdmp:key-from-QName(
$name as xs:QName
)  as   xs:string
Summary:

Construct a context-independent string from a QName. This string is of the form "{namespaceURI}localname" and is suitable for use as a map key.

Parameters:
$name : The QName to compute a key for.

Example:

            

xdmp:lshift64(
$x as xs:unsignedLong,
$y as xs:integer
)  as   xs:unsignedLong
Summary:

Left-shift a 64-bit integer value.

Parameters:
$x : The value to shift.
$y : The left shift to perform. This value may be negative.

Example:
  xdmp:lshift64(255, 2)
   => 1020

xdmp:md5(
$encoded as xs:string
)  as   xs:string
Summary:

Calculates the md5 hash of the given argument.

Parameters:
$encoded : String to be hashed.

Example:
  xdmp:md5("foo")
  => "acbd18db4cc2f85cedef654fccc4a4d8"
 

xdmp:mul64(
$x as xs:unsignedLong,
$y as xs:unsignedLong
)  as   xs:unsignedLong
Summary:

Muliply two 64-bit integer values, discarding overflow.

Parameters:
$x : The first value.
$y : The second value.

Example:
  xdmp:mul64(15107650474313474666,13290239292956375463)
  => 1404109880107289894

xdmp:node-kind(
$node as node()?
)  as   xs:string
Summary:

Returns an xs:string representing the node's kind: either "document", "element", "attribute", "text", "namespace", "processing-instruction", "binary", or "comment".

The fn:node-kind builtin was dropped from the final XQuery 1.0 spec. This is the equivalent function in the xdmp: namespace carried over for MarkLogic 1.0 dialects.


Parameters:
$node : The node whose kind is to be returned.

Example:
let $x := <hello><goodbye>1</goodbye></hello>
return
xdmp:node-kind($x/node())

=> element

xdmp:not64(
$x as xs:unsignedLong
)  as   xs:unsignedLong
Summary:

NOT a 64-bit integer value.

Parameters:
$x : The input value.

Example:
  xdmp:not64(255)
   => 18446744073709551360

xdmp:octal-to-integer(
$octal as xs:string
)  as   xs:integer
Summary:

Parses an octal string, returning an integer.

Parameters:
$octal : The octal string.

Example:
  xdmp:octal-to-integer("12345670")
   => 2739128

xdmp:or64(
$x as xs:unsignedLong,
$y as xs:unsignedLong
)  as   xs:unsignedLong
Summary:

OR two 64-bit integer values.

Parameters:
$x : The first value.
$y : The second value.

Example:
  xdmp:or64(255, 2)
   => 255

xdmp:parse-dateTime(
$picture as xs:string,
$value as xs:string,
[$language as xs:string],
[$calendar as xs:string],
[$country as xs:string]
)  as   xs:dateTime
Summary:

Parses a string containing date, time or dateTime using the supplied picture argument and returns a dateTime value. While this function is closely related to other XSLT functions, it is available in XSLT as well as in all XQuery dialects.

Parameters:
$picture : The desired string representation of the given $value. The picture string is a sequence of characters, in which the characters represent variables such as, decimal-separator-sign, grouping-sign, zero-digit-sign, digit-sign, pattern-separator, percent sign and per-mille-sign. For details on the picture string, see http://www.w3.org/TR/xslt20/#date-picture-string. This follows the specification of picture string in the W3C XSLT 2.0 specification for the fn:format-dateTime function.

   Symbol         Description
  -----------------------------------
     'Y'        year(absolute value)
     'M'        month in year
     'D'        day in month
     'd'        day in year
     'F'        day of week
     'W'        week in year
     'w'        week in month
     'H'        hour in day
     'h'        hour in half-day
     'P'        am/pm marker
     'm'        minute in hour
     's'        second in minute
     'f'        fractional seconds
     'Z'        timezone as a time offset from UTC
 	        for example PST 
     'z'        timezone as an offset using GMT,
 	        for example GMT+1
$value : The given string $value representing the dateTime value that needs to be formatted.
$language (optional): The language used in string representation of the date, time or dateTime value.
$calendar (optional): This argument is reserved for future use. The only calendar supported at this point is "Gregorian" or "AD".
$country (optional): $country is used to take into account if there any country specific interpretation of the string while converting it into dateTime value.

Usage Notes:

Dates before October 15, 1582 (the start of the Gregorian calendar) will not return the correct dateTime value.

Example:
   xdmp:parse-dateTime("[Y0001]-[M01]-[D01]T[h01]:[m01]:[s01].[f1][Z]","2010-01-06T17:13:50.873594-08:00")
 

xdmp:parse-yymmdd(
$picture as xs:string,
$value as xs:string,
[$language as xs:string],
[$calendar as xs:string],
[$country as xs:string]
)  as   xs:dateTime
Summary:

Parses a string containing date, time or dateTime using the supplied picture argument and returns a dateTime value. While this function is closely related to other XSLT functions, it is available in XSLT as well as in all XQuery dialects.

Parameters:
$picture : The desired string representation of the given $value. This follows the specification of picture string which is compatible to the format specification in icu. See "http://icu-project.org/apiref/classSimpleDateFormat.html" for more details. Here is the summary of the formatting symbols:

     Symbol     Description
  ----------------------------
     "y"       year(absolute value)
     "M"       month in year
     "d"       day in month
     "D"       day in year
     "E"       day of week
     "w"       week in year
     "W"       week in month
     "H"       hour in day
     "K"       hour in half-day
     "a"       am/pm marker
     "s"       second in minute
     "S"       fractional seconds
     "Z"       timezone as a time offset from UTC
 	       for example PST 
     "ZZZZ"    timezone as an offset using GMT,
 	       for example GMT+1
 
	     
$value : The given string $value that needs to be formatted.
$language (optional): The language used in string representation of the date, time or dateTime value.
$calendar (optional): This argument is reserved for future use. The only calendar supported at this point is "Gregorian" or "AD".
$country (optional): $country is used to take into account if there any country specific interpretation of the string while converting it into dateTime value.

Usage Notes:

Dates before October 15, 1582 (the start of the Gregorian calendar) will not return the correct dateTime value.

Example:
   xdmp:parse-yymmdd("yyyy-MM-ddThh:mm:ss.Sz","2010-01-06T17:13:50.873594-8.00")
 

xdmp:QName-from-key(
$key as xs:string
)  as   xs:QName
Summary:

Construct a QName from a string of the form "{namespaceURI}localname". This function is useful for constructing Clark notation parameters for the xdmp:xslt-eval and xdmp:xslt-invoke functions.

Parameters:
$key : The string from which to construct a QName.

Example:
xquery version "1.0-ml";
(: returns the Clark notation form of the QName :)

xdmp:key-from-QName(xs:QName("fn:foo"))
=>
{http://www.w3.org/2005/xpath-functions}foo

xdmp:random(
[$max as xs:unsignedLong]
)  as   xs:unsignedLong
Summary:

Returns a random unsigned integer between 0 and a number up to 64 bits long.

Parameters:
$max (optional): The optional maximum value (inclusive).

Example:
  xdmp:random(100)
  => 47

xdmp:rshift64(
$x as xs:unsignedLong,
$y as xs:integer
)  as   xs:unsignedLong
Summary:

Right-shift a 64-bit integer value.

Parameters:
$x : The value to shift.
$y : The right shift to perform. This value may be negative.

Example:
  xdmp:rshift64(255, 2)
   => 63

xdmp:sleep(
$msec as xs:unsignedInt
)  as   empty-sequence()
Summary:

Delays for a specific amount of time.

Parameters:
$msec : The amount of time to sleep, in milliseconds.

Example:
  xdmp:sleep(1000)
   => ()

xdmp:step64(
$initial as xs:unsignedLong,
$step as xs:unsignedLong
)  as   xs:unsignedLong
Summary:

Combines an initial hash with a subsequent hash.

Parameters:
$initial : An initial hash.
$step : A step hash to be combined with the initial hash.

Example:
  xdmp:step64(xdmp:hash64("initial"), xdmp:hash64("step"))
  => 12899951685816192752

xdmp:strftime(
$format as xs:string,
$value as xs:dateTime
)  as   xs:string
Summary:

Formats a dateTime value using POSIX strftime. This function uses the POSIX strftime system call in the way it is implemented on each platform. For other XQuery functions that have more functionality (for example, for things like timezones), use one or more if the various XQuery or XSLT standard functions such as fn:format-dateTime.

Parameters:
$format : The strftime format string.
$value : The dateTime value.

Usage Notes:

The supported format strings differ for different platforms. For the supported format strings for Windows, see the following link:

http://msdn2.microsoft.com/en-us/library/fe06s4ak(VS.80).aspx

For the supported format strings for Solaris, see the following link:

http://docs.sun.com/app/docs/doc/817-5438/6mkt5pcec?a=view

For the supported format strings for Linux, see the following link:

http://linux.about.com/library/cmd/blcmdl3_strftime.htm


Example:
  xdmp:strftime("%a, %d %b %Y %H:%M:%S",current-dateTime())
   => Tue, 08 Apr 2003 17:21:37

xdmp:user-last-login(
$user as xs:unsignedLong
)  as   element(last-login)?
Summary:

Returns the last-login node for the specified user ID. If no user ID is specified, then the current user is assumed. If no last-login database is specified in the App Server configuration, then the empty sequence is returned.

Parameters:
$user : A user ID.

Example:
  xdmp:user-last-login(xdmp:user("sylvester"))
  => 
  <last-login xmlns="http://marklogic.com/xdmp/last-login">
    <user-id>1134406269933351074</user-id>
    <last-successful-login>2008-03-19T15:41:08</last-successful-login>
    <last-unsuccessful-login>2008-03-19T15:40:45</last-unsuccessful-login>
    <number-unsuccessful-logins>0</number-unsuccessful-logins>
    <display-last-login>true</display-last-login>
  </last-login> 

xdmp:xor64(
$x as xs:unsignedLong,
$y as xs:unsignedLong
)  as   xs:unsignedLong
Summary:

XOR two 64-bit integer values.

Parameters:
$x : The first value.
$y : The second value.

Example:
  xdmp:xor64(255, 2)
   => 253