title: Folders first in paged results using CamlQuery and ListItemCollectionPosition
body: <p>I'm implementing paging using CamlQuery and ListItemCollection, sorting results by the name field. I would like folders to come first, as they do in UI, e.g. "folder A2, folder B2, file A1, file B1", but instead I get "file A1, folder A2, file B1, folder B2".</p>
  
  <p>What is the best way to accomplish such sorting and paging? Note that for paging I have to specify the value of the sorting field which will be the first record of the page – I've considered adding two sorting fields into CAML, but I'm not sure whether I can use two fields in ListItemCollectionPosition.PagingInfo.</p>
  
  <p>The code I'm currently using is like this:</p>
  
  <pre><code>var queryText = @"
     &lt;View&gt; 
         &lt;Query&gt; 
             &lt;OrderBy Override='TRUE'&gt; 
                 &lt;FieldRef Name='FileLeafRef' Ascending='True' /&gt;
             &lt;/OrderBy&gt; 
         &lt;/Query&gt; 
             ...
         &lt;RowLimit&gt; 
             10
         &lt;/RowLimit&gt; 
     &lt;/View&gt;";
  var camlQuery = new CamlQuery();
  camlQuery.ViewXml = queryText;
  camlQuery.ListItemCollectionPosition = new ListItemCollectionPosition
      {
          PagingInfo = "Paged=TRUE&amp;p_ID=1002&amp;p_FileLeafRef=A1"
      };
  var items = list.GetItems(camlQuery);
  </code></pre>