' This function will return a list of all the nodes and values in an XML Document. Public Shared Function DisplayXMLNodes(ByVal xmlStr As String) As String Dim xmlDoc As New XmlDocument If xmlStr.Trim <> "" Then xmlDoc.LoadXml(xmlStr) 'We don't care about the whitespace elements being displayed xmlDoc.PreserveWhitespace = False 'Call DisplayNodeInformation Return DisplayXMLNodes(xmlDoc, 0) & vbCrLf Else Return "" End If End Function 'This recursive function will walk the DOM of an XMLNode and return a string representation of it. Public Shared Function DisplayXMLNodes(ByVal xmlNode As XmlNode, ByVal indent As Integer) As String Dim results As String = "" Dim childNode As XmlNode If xmlNode.Name.StartsWith("#") Then results &= xmlNode.Value Else results = results & vbCrLf & Space(indent) & xmlNode.Name & ": " End If For Each childNode In xmlNode.ChildNodes results = results & DisplayXMLNodes(childNode, indent + 3) Next Return results End Function