convert &lt to < xml document

xml

Solution

When the `<` character appears in a text node, it will be serialized as `&lt;` when you write your xml to a file.

When you later read that file with an xml parser, the text node will contain the original `<` character.

You also have the option of CDATA encoding the text node. In this case the serialized character is `<` inside a CDATA block. Many XML APIs will not retain any difference between CDATA and text nodes. CDATA should be thought of as an escaping mechanism to make editing easy for human authors.

Problem

I have read an XML file and converted into NSXMLDocument object. But, due to the presence of "<" in the string content of a node, it has been converted into "&lt". So, when i write it as xml document to a file, it has the character "&lt" in it. How can i write to the file as ordinary XML file in which "&lt" will be replaced by "<". Thanks and Regards, Lenin

Original source