Hi, I played with a little bit with the docbook syntax and came to a problem with headers. The text for chapter headers is written between the title elements, to get the text I use the \xmlfirst command but this did not prevent the text in the element to appear again in the normal document text. As a workaround I introduced the \ifheading to flush the content only in chapter headers, is there a better way to do this? It is also possible to place the title elements outside of the chapter group where it is used as a header by itself, I did this now by another test \ifchapter where I test if it called within a chapter or not but a better solution is welcome. My last question is what I the preferef method to define entities in MkIV, \defineXMLentity is a MkII command and did not fit in the MkIV xmlsetup commands. \startbuffer[test] <?xml version='1.0'?> <book> <title>Document with &ConTeXt;</title> <chapter id="first"><title>The first Chapter</title> <para>Normal Text.</para> <para>Normal Text.</para> </chapter> <chapter id="second"><title>Another Chapter</title> <para>Normal Text.</para> <para>Normal Text.</para> </chapter> </book> \stopbuffer \unprotect \startxmlsetups setup \xmlsetsetup{\xmldocument}{title}{*} \xmlsetsetup{\xmldocument}{chapter}{*} \xmlsetsetup{\xmldocument}{para}{*} \stopxmlsetups \xmlregistersetup{setup} \newif\ifheading \newif\ifchapter \startxmlsetups title \ifchapter \ifheading\xmlflush{#1}\fi \else \title{\xmlflush{#1}} \fi \stopxmlsetups \startxmlsetups chapter \headingtrue \chaptertrue \chapter[\xmlatt{#1}{id}]{\xmlfirst{#1}{title}} \headingfalse \xmlflush{#1} \chapterfalse \stopxmlsetups \startxmlsetups para \xmlflush{#1}\par \stopxmlsetups \defineXMLentity [ConTeXt] \ConTeXt \protect \starttext \xmlprocessbuffer{main}{test}{} \stoptext Wolfgang