Even though the node attribute can be added to a collection mapped as idbag, this only results in an a ClassCastException. It does not generate correct dom4j element node for the collection.
The reason is that the org.hibernate.type.IdentifierBagType.instantiate() does not support dom4j entity mode. Not sure whether the fix would be as simple as returning an instance of PersistentElementHolder for dom4j or whether there is a fundamental reason why this would not work for idbag.
Please let me know if you need more information than this.
Out of date – DOM4J entity mode no longer supported