sp_showoptstats allows you to extract and display, in an XML document, statistics and histograms for various types of data objects from system tables such as systabstats and sysstatistics.
See the Reference Manual: Procedures and "Statistics Tables and Displaying Statistics with optdiag" in the Performance and Tuning Series: Improving Performance with Statistical Analysis.