---
title: "XDocument.Load"  
description: "XDocument.Load"  
author: "Anonymous User"  
published: 2014-08-28  
updated: 2014-08-28  
canonical: https://www.mindstick.com/forum/2178/xdocument-load  
category: "c#"  
tags: ["XDocument", "XmlReader", "XDocument.Load()", "XML document", "c#", ".net"]  
reading_time: 1 minute  

---

# XDocument.Load

I am loading [XML](https://www.mindstick.com/blog/203/working-with-xml-data-in-sql-server) from a [url](https://www.mindstick.com/forum/436/url-redirection) using XDocument.Load. It seems to work locally but fails in server. I have [IIS](https://www.mindstick.com/blog/286/how-to-host-php-on-windows-server-iis-8) 7, [ASP.NET MVC](https://www.mindstick.com/forum/155798/what-is-caching-in-asp-dot-net-mvc) 2 application. What specific [protocol](https://www.mindstick.com/forum/55090/what-is-stateless-protocol) the above [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) uses? What IIS [settings](https://www.mindstick.com/blog/63563/steps-to-change-the-wireless-settings-using-linksys-cloud-account) I need to [check](https://yourviews.mindstick.com/story/2248/never-forget-to-check-these-specifications-before-buying-a-mobile-phone)? Any help will be appreciated.

## Replies

### Reply by Sumit Kesarwani

Hi Ankit, try this:\

Dim doc As XDocument

doc = XDocument.Load("http://dl.dropbox.com/u/8842115/sample.xml")

For Each node In doc.Descendants("first")

Console.WriteLine(CType(node.Element("no"), String))

Next


---

Original Source: https://www.mindstick.com/forum/2178/xdocument-load

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
