I am using docx4j databinding to populate docx templates with some XPath 1.0 functions.
Is it possible to use XPath 2 or 3 functions with docx4j?
You'll need to configure an XPath 2/3 aware library.
Try Saxon HE. It may well "just work" once you've set it as your implementation.
Others are listed at https://en.wikipedia.org/wiki/XPath
See https://docs.oracle.com/javase/7/docs/api/javax/xml/xpath/XPathFactory.html#newInstance(java.lang.String) for how Java selects an implementation.
See also http://www.saxonica.com/documentation9.5/xpath-api/jaxp-xpath/factory.html
Let us know how you go. If repeats break, our XPathEnhancerLexer and XPathEnhancerParser may need some attention...