Quick tip: Get a SharePoint 2010 Lists XML file

There will be times that you need to fetch the XML file that describes one of your lists in SharePoint 2010. One example that pops to mind is when working with the Lists.asmx web service. You will need to have a visual of the XML file in case you need to operate on the data of the list in more depth.

So how do you get the XML file that describes a SharePoint 2010 list? Easy. You feed its URL to your browser and you’re promptly offered a dialog box to keep an offline version of the file.

Before you can use the following URL, you need to go fetch your list’s GUID. In case you do not know how to get a SharePoint 2010 List GUID follow the previous link.

If you do already have your list GUID, all you have to do it to replace the appropriate values (in bold) in the following URL string and pass it to your web browser:
http://serverName/sites/siteName/_vti_bin/owssvr.dll?Cmd=Display&List=GUID&XMLDATA=TRUE

I think that the whole line should also work in case you substituted GUID for the URL Encoded ID of the list GUID but it definitely works if you use the GUID as proposed in the aforementioned post. As soon as you have fed that line in the browser, the download dialog will display a request to download the xml file. You can then open or save it as you wish.

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

11 thoughts on “Quick tip: Get a SharePoint 2010 Lists XML file

  1. Is there a way to restore a list from this XML file?

    • MGR

      Hi there Rahsaan,
      I haven’t tried what you propose, but I wouldn’t expect there’d be a way to do this without custom code. However, why would you want to restore the list from the XML file when you can save the list as a template with content and then restore it that way?
      Hope that helps, cheers.

  2. Edison

    Thank you for sharing this.

    • MGR

      Glad you found it helpful.

  3. Nara

    We ran into this as well. The difference in what the rpc protocol returns (data vs an xml file) is a change in browser file handling which is a setting on the web application.

    SharePoint 2010 has a new opetion under the general settings of web applications that controls browser file handling. Try changing it to Permissive from Strict (default).

    The new option explanation from TechNet:

    Browser File Handling

    You can specify whether additional security headers are added to documents that are served to Web browsers. These security headers specify that a browser shows a download prompt for certain types of files (for example, .html), and to use the server’s specified Multipurpose Internet Mail Extensions (MIME) type for other types of files.

    The Permissive setting specifies that no headers are added. The Strict setting adds headers that force the browser to download certain types of files. The forced download improves security for the server by disallowing the automatic execution of Web content. By default, the setting is Strict.

    Configure settings for a web application (SP 2010) TechNet:

    http://technet.microsoft.com/en-us/library/cc262107.aspx

    • MGR

      That’s great Nara, thank you for letting me know. Hopefully, Mauricio will also see your answer.

  4. Mauricio

    How can I get the XML that represents the SharePoint 2010 List, but not as a file, I need to display that info into the browser?

    Thank you

    • MGR

      Thank you for your comment Mauricio, and please accept my apologies for the late reply. Truth be told, I never tried to display the data directly from the “owssvr.dll”. I gave it a go just now, after I read your comment, and I didn’t manage to get it to work. I normally access the owssver.dll and save the file before I open it. A much more complete blog post about the use of this .dll can be found here. I may get back to checking this out later on but for now, I guess, we’ll have to stick with the offline .xml file that is being served by this Front Page – Remote Procedure Call.
      Cheers.

    • Hernan

      did you find the solution? Thanks, Hernan

      • MGR

        Hi Hernan. I don’t know if Mauricio did, I never actually looked for one to be honest. I’ve moved to working with Telerik Sitefinity and seldom ever fire up SharePoint anymore. Sorry to disappoint.
        Did you try Nara’s suggestion?
        Good luck!

  5. adriyas

    Nice tip. Keep up the good work! And thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.