SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to retrieve lists from a sharepoint site. I know how to do it using web services. However, the requirement is that I need to use Xelement GetList and the output should have PropertiesXML properties. Can anyone help??

share|improve this question

Try this code snippet:

 private void GetSourceListCollection()

//SharePointList is my custom business object with properties.
            List<SharePointList> sourceListColl = new List<SharePointList>();
            XmlNode listsNode = listsSvcProxy.GetListCollection();
            string xmlnamespace = @"";
            var listsElements = from lists in listNode.DescendantsAndSelf((XNamespace)xmlnamespace + "List")
                                    select lists;

                foreach (XElement listelement in listsElements)
                    SharePointList list = new SharePointList();
           = listelement.Attribute("ID").Value;
                    list.title = listelement.Attribute("Title").Value;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.