Question : XML

Hi Experts,
I am badly got struck in convertiong this striong to xml. I got hold for last 2 days, please help me.
I am getting this string from web service. I need to convert this into xml format. Please find the input string and code which i am running in attachment.  Please help me.

My existing code is below,

            XmlDocument xd = new XmlDocument();
            XmlDeclaration xmlDeclaration = getXML.CreateXmlDeclaration("1.0", "utf-8", null);
            xd.CreateXmlDeclaration("1.0", "utf-8", null);
            //xd.InsertBefore(xmlDeclaration, xd.DocumentElement);
            XmlNode xn = xd.CreateNode(XmlNodeType.Element, "NameAddressResponse", "http://www.kitty.com/authNO/getasm");
           
            xn.InnerText = strParseResult; //strParseResult is the input string
            xd.AppendChild(xn);

Advance Thanks.

Kind Regards,
Suresh

Attachments:
 
Input and output
 

Answer : XML

Try setting the InnerXml property of the new node instead:
1:
2:
3:
4:
XmlNode xn = xd.CreateNode(XmlNodeType.Element, "NameAddressResponse", "http://www.kitty.com/authNO/getasm");
xn.InnerXml = strParseResult;

xd.AppendChild(xn);
Random Solutions  
 
programming4us programming4us