For MXQuery, there is range of documents available covering the following usage

Building MXQuery

MXQuery  Usage Examples

MXQuery XQuery Extensions

MXQueryAPIs