Here is synopsis for 'xml esc' command:
xml esc --help XMLStarlet Toolkit: Escape special XML characters Usage: xml esc [<options>] [<string>] where <options> are --help - print usage (TODO: more to be added in future) if <string> is missing stdin is used instead. XMLStarlet is a command line toolkit to query/edit/check/transform XML documents (for more information see http://xmlstar.sourceforge.net/)
EXAMPLE
# Escape special XML characters cat xml/structure.xml | xml esc
Input
<a1>
<a11>
<a111>
<a1111/>
</a111>
<a112>
<a1121/>
</a112>
</a11>
<a12/>
<a13>
<a131/>
</a13>
</a1>Output
<a1>
<a11>
<a111>
<a1111/>
</a111>
<a112>
<a1121/>
</a112>
</a11>
<a12/>
<a13>
<a131/>
</a13>
</a1>