Xml with multple element split
Below is my XML string :<br /> <br /> <Header><br /> <Fr><br /> <Id><br /> <Fin><br /> <Clr><br /> <MId>002</MId><br /> </Clr><br /> </Fin><br /> </Id><br /> </Fr><br /> <To><br /> <Id><br /> <Fin><br /> <Clr><br /> <MId>025</MId><br /> </Clr><br /> </Fin><br /> </Id><br /> </To><br /> <Msgid>93734</Msgid><br /> </Header><br /> <Body><br /> <F1><br /> <GH><br /> <A>KANG201611021631893734</A><br /> <B>2016-11-02T04:11:52</B><br /> <C>1</C><br /> <D Ccy = "INR">2500.00</D><br /> <E>2016-11-02</E><br /> </GH><br /> <CD><br /> <P><br /> <E1>/XUTR/KANGH16307631893734</E1><br /> <T1>KANGR520161102631893734</T1><br /> </P><br /> <P2><br /> <I1>HIGH</I1><br /> <S1><br /> <P2>asd</P2><br /> </S1><br /> <L1><br /> <P4>werwer</P4><br /> </L1><br /> <C6><br /> <cc>100</cc><br /> </C6><br /> </P2><br /> </CD><br /> </F1><br /> </Body><br /> <br /> <br /> In this XML Multiple elements like "Header" and "Body"<br /> i want to split this single string to two as separate Header and Body .<br /> <br /> <strong>What I have tried:</strong><br /> <br /> string xml = "<root>" + messageStream + "</root>";<br /> XDocument doc = XDocument.Parse(xml); <br /> //String status = doc.Root.Element("Header").Value;