\enabledirectives[lxml.escapedentities]

\setupbodyfont[dejavu]

\xmltexentity{degree}{\textdegree}

\startbuffer[test]
<text>
    Random text with an entity: &degree; <par/> test
</text>
\stopbuffer

\startxmlsetups xml:testsetups
    \xmlsetsetup{#1}{text}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:text
    \xmlflush{#1}\par
\stopxmlsetups

\starttext
    \xmlprocessbuffer{main}{test}{}
\stoptext
