Parsing an XML File for a single word/phrase this is a small part of my code that allows me to request a file through a load balancer, reading this XML file gives me the server's name (only node inside the XML Document) if the machine isn't inside the LAN then it won't be able to query the website.  I give it a longer timeout to make sure that I don't get a ton of errors emailed to me if the network is laggy.

Here is the XML file Structure.

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Server&gt;
    JSODYAPP01T
&lt;/Server&gt;


Here is the Code that retrieves the information

WebRequest request = WebRequest.Create(xmlLocation);
request.Timeout = 90000;

using (WebResponse response = request.GetResponse())
using (XmlReader xmlReader = XmlReader.Create(response.GetResponseStream()))
{
    while (xmlReader.Read())
    {
        if (xmlReader.NodeType == XmlNodeType.Text)
        {
            serverName = xmlReader.Value.ToString();
            serverName = serverName.Replace("\r", "");
            serverName = serverName.Replace("\n", "");
            serverName = serverName.Replace(" ", "");
        }
    }
}


is there a better way of doing this?
Linq to XML is your friend

var serverName = XDocument.Load(response.GetResponseStream()).Element("Server").Value;


Your code will be easily broken if someone adds a node to the XML, and your code should be as flexible as possible. Never do such an assumption (It's gonna be the first node)

Your method is blocking, consider making it asynchronous.

using (var response = await request.GetResponseAsync()){

}


And by the way, C# got type inference, so why bother typing the type? Use var instead 

var request = WebRequest.Create(xmlLocation);