Best place to start is in the ormsupport classes sourcecode which is in the llblgen pro installation folder
The easiest predicate class is the FieldCompareNullPredicate, so you get an idea how it works and what to call.
Basicly you derive a class from Predicate and emit the SQL in ToQueryText().
One thing to note: in adapter, the DataAccessAdapter will check which predicate class is passed in and will then request the fields and other elements to inject persistence info. As this is different for each predicate, it had to be done via a switch /case.
This routine is in the generated code, InsertPersistenceInfoObjects(IPredicateExpression expression).
To make it extensible, it calls the OnInsertPersistenceObjects routine, which normally does nothing. If you implement your own XQuery predicate class, you could simply override OnInsertPersistenceObjects in a derived class of DataAccessAdapter and inject the persistence info of the various elements in your XQuery predicate in that routine. You don't have to do the persistence info injection yourself, just use the overloads, like the InsertPersistenceInfoObjects(expression) or other ones.