I am using Libxml2 for encoding the data in a xml file. My data contain tags like \"<\" and \">\". when it is converted into xml these tags are also converted into \"<\
You have to call xmlNewChild
in a chain, one call for the parent node and a call each for each sub-node:
xmlNodePtr *addressNode = xmlNewChild(node, NULL, (xmlChar *) "address", NULL);
xmlNewChild(addressNode, NULL, (xmlChar *) "street", "Park Street");
xmlNewChild(addressNode, NULL, (xmlChar *) "city", "Koltaka");