XDocument is prepending string

DNG

New Member
I'm generating XML using XDocument in C#.Everything works fine except I always get auto generated string\[code\]XDocument doc = new XDocument( new XDeclaration("1.0", "UTF-8", "yes"), new XElement(aw+"ProviderUpdate", //... more more here ) );return doc.ToString();\[/code\]It always return something like this: How do I remove ?\[code\]<string xmlns="urn:Microsoft.Search.Registration.Response"><ProviderUpdate xmlns="urn:Microsoft.Search.Registration.Response">...</ProviderUpdate></string>\[/code\]I expected to be something like this:\[code\]<?xml version="1.0" encoding="utf-8"?><ProviderUpdate xmlns="urn:Microsoft.Search.Registration.Response">...</ProviderUpdate>\[/code\]This is defined at top of my file:\[code\][WebService(Namespace = "urn:Microsoft.Search.Registration.Response")]\[/code\]But it does nothing else than change xmlns to a correct value.
 
Back
Top