# fn:data - XPath XQuery Reference

Returns the result of atomizing a sequence. This process flattens arrays, and replaces nodes by their typed values.deterministiccontext-dependentfocus-dependentdeterministiccontext-independentfocus-independentIf the argument is omitted, it defaults to the context item (.). The
            behavior of the function if the argument is omitted is exactly the same as if the
            context item had been passed as the argument. The result of fn:data is the sequence of atomic values produced by
            applying the following rules to each item in $arg:If the item is an atomic value, it is appended to the result sequence.If the item is a node, the typed value of the node is appended to the result
                  sequence. The typed value is a sequence of zero or more atomic values:
                  specifically, the result of the dm:typed-value accessor as defined in
                      (See ).If the item is an array, the result of applying fn:data to
                  each member of the array, in order, is appended to the result sequence.data(123)123data((123, 456))123, 456data([[1,2],[3,4]])1, 2, 3, 4
<para>In a hole in the ground there lived a <term author="Tolkien">hobbit</term>.</para>data($para)xs:untypedAtomic("In a hole in the ground there lived a hobbit.")data($para/term/@author)xs:untypedAtomic("Tolkien")data(abs#1)A type error is raised  if an item in the
            sequence $arg is a node that does not have a typed value. A type error is raised  if an item in
            the sequence $arg is a function item other than
               an array. A dynamic error is raised if $arg is omitted and the context item is
               absent.The process of applying the fn:data function to a sequence is referred to
            as atomization. In many cases an explicit call on fn:data is
            not required, because atomization is invoked implicitly when a node or sequence of nodes
            is supplied in a context where an atomic value or sequence of atomic values is
            required.The result of atomizing an empty sequence is an empty sequence.The result of atomizing an empty array is an empty sequence.