Search code examples
javaxmlescaping

how to unescape XML in java


I need to unescape a xml string containing escaped XML tags:

<
>
&
etc...

I did find some libs that can perform this task, but i'd rather use a single method that can perform this task.

Can someone help?

cheers, Bas Hendriks


Solution

  • Apache Commons Lang

    Apache provides the Commons Lang library.

    StringEscapeUtils.unescapeXml(xml)
    

    (commons-lang, download)