XmlNode Inner String

RoniPro

New Member
Is there any way to take \[code\]<any>\[/code\] tagged \[code\]XmlElement\[/code\] inner string without any indent change?Package.xml:\[code\]<package><id>5</id><any> <invoice> <foo></foo> <bla></bla><sign></sign> </invoice></any></package>\[/code\]Expected string:\[code\]<invoice> <foo></foo> <bla></bla><sign></sign></invoice>\[/code\]When i get it with package object (which is deserialized object of package.xml)package.any.OuterXml():\[code\]<invoice><foo></foo><bla></bla><sign></sign></invoice>\[/code\]When i use this:\[code\]using (var sw = new System.IO.StringWriter()) { using (var xw = new System.Xml.XmlTextWriter(sw)) { xw.Formatting = System.Xml.Formatting.Indented; xw.Indentation = indentation; node.WriteContentTo(xw); } return sw.ToString(); }\[/code\]I get:\[code\]<invoice> <foo></foo> <bla></bla> <sign></sign></invoice>\[/code\]
 
Back
Top