<p>I would like to display details of an xml error log to a user in a winforms application and am looking for the best control to do the job.</p>

<p>The error data contains all of the sever variables at the time that the error occurred. These have been formatted into an XML document that looks something to the effect of:</p>

<pre><code>&lt;error&gt;
    &lt;serverVariables&gt;
        &lt;item&gt;
            &lt;value&gt;
        &lt;/item&gt;
    &lt;/serverVariables&gt;
    &lt;queryString&gt;
        &lt;item name=""&gt;
            &lt;value string=""&gt; 
        &lt;/item&gt;
    &lt;/queryString&gt;      
&lt;/error&gt;
</code></pre>

<p>I would like to read this data from the string that it is stored in and display it to the user via a windows form in a useful way. XML Notepad does a cool job of formatting xml, but is not really was I am looking for since I would prefer to rather display item details in a <em>Name : string</em> format.</p>

<p>Any suggestions or am I looking and a custom implementation?</p>

<p>[EDIT] A section of the data that needs to be displayed:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;error host="WIN12" type="System.Web.HttpException" message="The file '' does not exist." source="System.Web" detail="System.Web.HttpException: The file '' does not exist. at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath) at" time="2008-09-01T07:13:08.9171250+02:00" statusCode="404"&gt;
  &lt;serverVariables&gt;
    &lt;item name="ALL_HTTP"&gt;
      &lt;value string="HTTP_CONNECTION:close HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) " /&gt;
    &lt;/item&gt;
    &lt;item name="AUTH_TYPE"&gt;
      &lt;value string="" /&gt;
    &lt;/item&gt;
    &lt;item name="HTTPS"&gt;
      &lt;value string="off" /&gt;
    &lt;/item&gt;
    &lt;item name="HTTPS_KEYSIZE"&gt;
      &lt;value string="" /&gt;
    &lt;/item&gt;
    &lt;item name="HTTP_USER_AGENT"&gt;
      &lt;value string="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" /&gt;
    &lt;/item&gt;
  &lt;/serverVariables&gt;
  &lt;queryString&gt;
    &lt;item name="tid"&gt;
      &lt;value string="196" /&gt;
    &lt;/item&gt;
  &lt;/queryString&gt;
&lt;/error&gt;
</code></pre>

[{'answer_id': 37612, 'author': 'Skizz', 'author_id': 1898, 'author_profile': 'https://Stackoverflow.com/users/1898', 'pm_score': 0, 'selected': False, 'text': '<p>You could try using the <code>DataGridView</code> control. To see an example, load an XML file in DevStudio and then right-click on the XML and select "View Data Grid". You\'ll need to read the API documentation on the control to use it.</p>\n'}, {'answer_id': 37631, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 2, 'selected': True, 'text': '<p>You can transform your XML data using <a href="http://www.xml.com/pub/a/2002/08/14/dotnetxslt.html" rel="nofollow noreferrer">XSLT</a><br>\nAnother option is to use XLinq.<br>\nIf you want concrete code example provide us with sample data</p>\n\n<p><strong>EDIT</strong>:\nhere is a sample XSLT transform for your XML file:  </p>\n\n<pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;\n    &lt;xsl:output method="text"/&gt;\n    &lt;xsl:template match="//error/serverVariables"&gt;\n      &lt;xsl:text&gt;Server variables:\n      &lt;/xsl:text&gt;\n      &lt;xsl:for-each select="item"&gt;\n        &lt;xsl:value-of select="@name"/&gt;:&lt;xsl:value-of select="value/@string"/&gt;\n        &lt;xsl:text&gt;\n        &lt;/xsl:text&gt;\n      &lt;/xsl:for-each&gt;\n    &lt;/xsl:template&gt;\n    &lt;xsl:template match="//error/queryString"&gt;\n      &lt;xsl:text&gt;Query string items:\n      &lt;/xsl:text&gt;\n      &lt;xsl:for-each select="item"&gt;\n        &lt;xsl:value-of select="@name"/&gt;:&lt;xsl:value-of select="value/@string"/&gt;\n        &lt;xsl:text&gt;\n        &lt;/xsl:text&gt;\n      &lt;/xsl:for-each&gt;\n    &lt;/xsl:template&gt;\n&lt;/xsl:stylesheet&gt;\n</code></pre>\n\n<p>You can apply this transform using <a href="http://msdn.microsoft.com/en-us/library/system.xml.xsl.xslcompiledtransform.aspx" rel="nofollow noreferrer">XslCompiledTransform</a> class.\nIt should give output like this:</p>\n\n<blockquote>\n  <p>Server variables:<br>\n          ALL_HTTP:HTTP_CONNECTION:close HTTP_USER_AGENT:Mozilla/4.0 (compatible MSIE 6.0; Windows NT 5.1; SV1)<br>\n            AUTH_TYPE:<br>\n            HTTPS:off<br>\n            HTTPS_KEYSIZE:<br>\n            HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;S )  </p>\n  \n  <p>Query string items:<br>\n          tid:196  </p>\n</blockquote>\n'}, {'answer_id': 37704, 'author': 'ljs', 'author_id': 3394, 'author_profile': 'https://Stackoverflow.com/users/3394', 'pm_score': 0, 'selected': False, 'text': "<p>You could use a treeview control and use a recursive XLinq algorithm to put the data in there. I've done that myself with an interface allow a user to build up a custom XML representation and it worked really well.</p>\n"}, {'answer_id': 37740, 'author': 'Eugene Yokota', 'author_id': 3827, 'author_profile': 'https://Stackoverflow.com/users/3827', 'pm_score': 0, 'selected': False, 'text': '<p>See <a href="http://en.wikipedia.org/wiki/XML%5FData%5FBinding" rel="nofollow noreferrer">XML data binding</a>.\nUse Visual Studio or <a href="http://msdn.microsoft.com/en-us/library/x6c1kb0s%28VS.71%29.aspx" rel="nofollow noreferrer">xsd.exe</a> to generate DataSet or classes from XSD, then use <a href="http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx" rel="nofollow noreferrer"><code>System.Xml.Serialization.XmlSerializer</code></a> if needed to turn your XML into objects/DataSet. Massage the objects. Display them in grid.</p>\n'}]
['https://Stackoverflow.com/questions/37591', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/231/']