This tour will help you manage the complexity of the cts API, breaking down its 217 functions into distinct categories and identifying consistent patterns in the cts function naming conventions.
Namespace-related bugs are a pain in the neck. You can avoid a large class of them by pretending that the name() function never existed (and avoid using it).
How do you control how your query or stylesheet results will be serialized (encoding, indentation, etc.)? There are several options for controlling output options.