|{{Func|convert:from-java|$items as item()*|item()*}}
|-
| '''Summary'''
|Tries to convert Java objects, which result from the invocation of [[Java Bindings#Data Types|Java Code]], to XQuery values. The supplied {{Code|$items}} are processed one by one:
* If an item is already an XQuery value (e.g., as result from the default mapping), it is returned unchanged.
* If an item wraps an {{Code|Iterable}} ({{Code|Collection}}, {{Code|List}}, {{Code|Set}}, others) or {{Code|Iterator}}, the contained objects are recursively converted to XQuery.
* If an item wraps a {{Code|Map}}, the entries are recursively converted to an XQuery map.
* If no conversion is possible, an error is raised.
|-
| '''Examples'''
|Adds 1000 values to {{Code|HashSet}} and returns the number of distinct entries: