• Personally I find XML (with an XML parser to properly do the indentation) much easier to read than JSON and it is a shame that JSON seems to be the default format for DTO activities such as API results.  Glad than MS finally saw the light and included JSON in 2016/VNext

    A couple of things to be aware of with XML, All of the nested SELECT statements effectively run independently so are a hidden RBAR so if you have a structure like

    <Customers>
      <Customer>
       ...
        <Invoices>
          <Invoice>
           ...
           <Lines>
              <Line>
               ... 
               <SerialNumbers>
                  <SerialNumber>
                   ...

    Then that is a lot of processing overhead.

    Secondly, If you have a really large dataset which you have output as a single XML results field, you might have issues with saving the results.  I once created a file for 25,000 rent letters with up to 5 levels of nested data and the resulting XML file was 1.4M elements and wouldn't fit into memory.  I ended up having to save the letter fragments to a temp table and then BCP the table contents to a file.