How to print "<" and ">" using XQuery?
I recommend using XQuery element constructors . Dynamic elements can be created using the calculated elements constructor :
element book {
attribute isbn {"isbn-0060229357" },
element title { "Harold and the Purple Crayon"},
element author {
element first { "Crockett" },
element last {"Johnson" }
}
}
leads to
<book isbn="isbn-0060229357">
<title>Harold and the Purple Crayon</title>
<author>
<first>Crockett</first>
<last>Johnson</last>
</author>
</book>
(Example from the W3C XQuery specification )
In your case, you can use
element newTag { ... }