You can use the Client API as well within a Pluggable widget. I believe my ArcGIS widget, based on the Pluggable Widgets API, see Marketplace, does this as well.
I would like to challenge you on using the datasource from the Pluggable Widgets API though as that is the way to go for now. Can’t you solve this dynamic part with a flexible domain model set up?
Other option; build the XPath yourself and then feed it to a Java action to get the correct List of Objects. Feed that list of objects via a datasource construction to the new widget.