I have xsl:param which is instance of Collection, every time I pass this parameter into Java extension I get new instance of ArrayList, it does not use passed object. Why is that?
When you pass a Java List into XSLT, Saxon interprets it as an XPath sequence, converting each item in the list separately to an XPath node or value. This is the right thing to do in many use cases, for example when you want to pass a sequence of strings as the identifiers of objects to be processed in your query or stylesheet. Similarly, if you pass an XPath sequence from XSLT to Java, it will be converted to a Java List.
If you don't want this conversion to happen, the only thing I can suggest is to wrap your List in a Java object that Saxon doesn't recognize as anything special.
The rules are explained at
(Note that the rules for converting an externally supplied value for xsl:param are the same as the rules for converting the result of an extension function)
Thanks, wrapping collection in custom object solves the problem.