The answer for most Character encoding is Apache StringEscapeUtils in the commons.text version. Agree. Can be used to escape the strings between the xml tags. But how do I escape the xml tokens themselves?
Allowed chars are simple: https://www.w3.org/TR/xml11/#sec-common-syn
My use case is that I convert a database table into an XML where each column name is one xml token.
<ROW><COL1>Hello</COL1></ROW>
Works fine but what if the column name is "/BIC/COL1"?
<ROW></BIC/COL1>Hello<//BIC/COL1></ROW>
is obviously not valid. Currently I do not even have a plan on how the encoding might look like. Would need to use a _x26BIC_x26COL1 tag name or something similar.
Anything I overlook?