Thanks for your advice.
I would like to have a system with which I can send letters to people in my database.
It would be nice to be able to make selections according to labels (probably with xmlatt), but that can be done later.
I am not a programmer - when I read the documentation, I do not understand enough of it to the extent to port it to a new program, but I can adapt and try existing code.
Thusfar I have been trying to use the letter module with the xmltext and xmlflush commands. What can be done to make this work?
\usemodule[letter]
\startbuffer[participants]
<contacts>
<contact class='participant' label='Hendriks'>
<formalname>Hendriks</formalname>
<informalname>Karel</informalname>
<prefix>mr.</prefix>
<initials>K.</initials>
<courselevel>levelA</courselevel>
<coursedate>1 june 2017</coursedate>
<city>Arnhem</city>
<address>
<p>Mr. K. Hendriks</p>
<p>Grotestraat 5</p>
<p>1234 Arnhem</p>
</address>
</contact>
<contact class='participant' label='Janssen'>
<formalname>Janssen</formalname>
<informalname>Piet</informalname>
<initials>P.</initials>
<prefix>mr.</prefix>
<courselevel>levelA</courselevel>
<coursedate>1 june 2017</coursedate>
<city>Nijmegen</city>
<address>
<p>Mr. P. Janssen</p>
<p>Kortestraat 8</p>
<p>1234 Nijmegen</p>
</address>
</contact>
</contacts>
\stopbuffer
\startxmlsetups xml:setups
\xmlsetsetup{#1}{contacts|contact|address|prefix}{xml:*}
\stopxmlsetups
\xmlregistersetup{xml:setups}
\startxmlsetups xml:contacts
\xmlflush{#1}
\stopxmlsetups
\startxmlsetups xml:contact
%\setupletter[
% name={Sender},
% email={},
% signature={X}]
\startletter
[opening={Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},},
closing={Kind regards,},
signature={X},
toaddress={\xmltext{#1}{/address}},
subject={Interesting offer}]
\input knuth
%\xmltext{#1}{/informalname}
%Without the letter instructions, the code yields the names in informalname.
\stopletter
\stopxmlsetups
\starttext
\xmlprocessbuffer{main}{participants}{}
\stoptext