title: How to use or implement arrays in XQuery?
body: <p>Is there any built in support for array in XQuery? For example, if we want to implement
  the simple java program in xquery how we would do it:</p>
  
  <p>(I am not asking to translate the entire program into xquery, but just asking
   how to implement the array in line number 2 of the below code to xquery? I am
   using marklogic / xdmp functions also).</p>
  
  <pre><code>java.lang.String test = new String("Hello XQuery");
  char[] characters = test.toCharArray();
  
  for(int i = 0; i&lt;characters.length; i++) {
      if(character[i] == (char)13) { 
          character[i] = (char) 0x00;
      }
  }
  
  Legend:
  
  hex 0x00 dec 0 : null
  hex 0x0d dec 13: carriage return
  hex 0x0a dec 10: line feed
  hex 0x20 dec 22: dquote
  </code></pre>