The manual "XML in ConTeXt" (example.pdf) says:
When you want to convert TEX documents into xml (or html) counterparts, it makes sense to use TEX itself, because that way we have the full engine at our fingertips. In ConTEXt we use a strange but charming way to handle this conversion: we simply typeset xml. The typeset document (with lots of angle brackets) is then converted into raw text. A complication is math, but given that you can embed MathML in your document, this can be passed on directly.
How can this be done?