\ConTeXt\ is great
but you need to know some tricks
\stopbuffer
\startxmlsetups xml:initialize
\xmlsetsetup{#1}{doc|p|code}{xml:*}
\xmlsetsetup{#1}{pre/code}{xml:pre:code}
\stopxmlsetups
\xmlregistersetup{xml:initialize}
\startxmlsetups xml:doc
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:pre:code
no solution
\comment[symbol=Key, location=inmargin,color=yellow]{\xmlflush{#1}}
\par
solution one \begingroup
\expandUx
\comment[symbol=Key, location=inmargin,color=yellow]{\xmlflush{#1}}
\endgroup
\par
solution two
\comment[symbol=Key, location=inmargin,color=yellow]{\xmlpure{#1}}
\par
\xmlprettyprint{#1}{tex}
\stopxmlsetups
\xmlprocessbuffer{main}{demo}{}
\stoptyping
The first comment (an interactive feature of \PDF\ comes out as:
\starttyping
\Ux {5C}ConTeXt\Ux {5C} is great
\stoptyping
The second and third comment are okay. It's one of the reasons why we have \type
{\xmlpure}.
\stopsection
\stopchapter
\stopcomponent