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