xmlns=''> was not expected. - There is an error in XML document (2, 2)

Declaring XmlSerializer as

XmlSerializer s = new XmlSerializer(typeof(string),new XmlRootAttribute("response"));

is enough.


You want to deserialize the XML and treat it as a fragment.

There's a very straightforward workaround available here. I've modified it for your scenario:

var webRequest = WebRequest.Create("http://inb374.jelastic.tsukaeru.net:8080/VodafoneDB/webresources/vodafone/04111111");

using (var webResponse = webRequest.GetResponse())
using (var responseStream = webResponse.GetResponseStream())
{
    var rootAttribute = new XmlRootAttribute();
    rootAttribute.ElementName = "response";
    rootAttribute.IsNullable = true;

    var xmlSerializer = new XmlSerializer(typeof (string), rootAttribute);
    var response = (string) xmlSerializer.Deserialize(responseStream);
}