Just thought I'd drop a thread in, I've written a little ditty that searchs for specific tags within XML and returns a UDT with the details of that tag. (It uses the MSXML.DLL).

Don't know if you'll find it useful but here it is anyhoo:

VB Code:
  1. Option Explicit
  2. '*Super Lucy Code* :-D
  3. Dim XMLDoc                  As MSXML2.DOMDocument
  4. Type XMLPath
  5.     Name            As String
  6.     Properties()    As String
  7. End Type
  8. Type XMLData
  9.     Data            As String
  10.     Properties()    As String
  11.     Path()          As XMLPath
  12. End Type
  13.  
  14. Sub Main()
  15. 'This sub demos how to use the other procedures...
  16. Dim myXMLData()   As XMLData
  17. ReDim myXMLData(0)
  18. If GetDataFromXMLDoc("C:\custexp_day.xml", "SYSTEM", myXMLData) = True Then
  19.  
  20. End If
  21.  
  22. End Sub
  23.  
  24. Function GetDataFromXMLDoc(ByVal sFileName As String, ByVal sSearchString As String, ByRef DataFromXML() As XMLData) As Boolean
  25. Set XMLDoc = New DOMDocument
  26. XMLDoc.async = False
  27. XMLDoc.Load sFileName
  28. If XMLDoc.parseError.errorCode = 0 And XMLDoc.readyState = 4 Then
  29.     'Ready
  30.     Call TraverseXML(sSearchString, XMLDoc, DataFromXML, "", "")
  31. End If
  32. End Function
  33. Sub TraverseXML(ByVal sSearchString As String, ByVal XMLDoc As IXMLDOMNode, ByRef DataFromXML() As XMLData, _
  34.                 ByVal sPath As String, ByVal sPathProperties As String)
  35. Dim iStep               As Integer
  36. Dim bytStepProperties   As Byte
  37. Dim bytPath             As Byte
  38. Dim bytCountDepthInTree As Byte
  39. Dim bytPathStep         As Byte
  40. Dim varTreeSplit        As Variant
  41. Dim varTreePropSplit    As Variant
  42.  
  43. sPath = sPath & "\" & XMLDoc.baseName
  44.  
  45. sPathProperties = sPathProperties & "¬"
  46. If XMLDoc.baseName <> "" Then
  47.     For bytPathStep = 1 To XMLDoc.Attributes.length
  48.         sPathProperties = sPathProperties & "~" & XMLDoc.Attributes.Item(bytPathStep - 1).baseName & "=" & XMLDoc.Attributes.Item(bytPathStep - 1).nodeValue
  49.     Next bytPathStep
  50. End If
  51. For iStep = 1 To XMLDoc.childNodes.length
  52.    
  53.    
  54.     If XMLDoc.childNodes.Item(iStep - 1).nodeName = sSearchString Then
  55.         ReDim Preserve DataFromXML(UBound(DataFromXML) + 1)
  56.        
  57.         'Read data
  58.         DataFromXML(UBound(DataFromXML)).Data = XMLDoc.childNodes.Item(iStep - 1).nodeTypedValue
  59.        
  60.         'Read properties
  61.         ReDim DataFromXML(UBound(DataFromXML)).Properties(XMLDoc.childNodes.Item(iStep - 1).Attributes.length)
  62.         For bytStepProperties = 1 To XMLDoc.childNodes.Item(iStep - 1).Attributes.length
  63.             DataFromXML(UBound(DataFromXML)).Properties(bytStepProperties) = XMLDoc.childNodes.Item(iStep - 1).Attributes.Item(bytStepProperties - 1).baseName
  64.             DataFromXML(UBound(DataFromXML)).Properties(bytStepProperties) = DataFromXML(UBound(DataFromXML)).Properties(bytStepProperties) & "~" & _
  65.                 XMLDoc.childNodes.Item(iStep - 1).Attributes.Item(bytStepProperties - 1).nodeTypedValue
  66.         Next bytStepProperties
  67.            
  68.         'Read Path
  69.         varTreeSplit = Split(sPath, "\", , vbTextCompare)
  70.         bytCountDepthInTree = UBound(varTreeSplit) - 1
  71.  
  72.         ReDim DataFromXML(UBound(DataFromXML)).Path(bytCountDepthInTree)
  73.  
  74.         For bytStepProperties = 1 To bytCountDepthInTree
  75.             DataFromXML(UBound(DataFromXML)).Path(bytStepProperties).Name = varTreeSplit(bytStepProperties + 1)
  76.  
  77.         Next bytStepProperties
  78.        
  79.         'Read path properties into path
  80.         varTreeSplit = Split(sPathProperties, "¬", , vbTextCompare)
  81.        
  82.         'Loop through paths
  83.         For bytStepProperties = 1 To bytCountDepthInTree
  84.             If InStr(1, varTreeSplit(bytStepProperties + 1), "~") > 0 Then
  85.                 varTreePropSplit = Split(varTreeSplit(bytStepProperties + 1), "~", , vbTextCompare)
  86.                 ReDim DataFromXML(UBound(DataFromXML)).Path(bytStepProperties).Properties(UBound(varTreePropSplit))
  87.            
  88.                 'Loop through path properties
  89.                 For bytPathStep = 1 To UBound(varTreePropSplit)
  90.                    
  91.                     DataFromXML(UBound(DataFromXML)).Path(bytStepProperties).Properties(bytPathStep) = varTreePropSplit(bytPathStep)
  92.        
  93.                 Next bytPathStep
  94.             Else
  95.                 ReDim DataFromXML(UBound(DataFromXML)).Path(bytStepProperties).Properties(0)
  96.             End If
  97.        
  98.         Next bytStepProperties
  99.    
  100.     Else
  101.         Call TraverseXML(sSearchString, XMLDoc.childNodes.Item(iStep - 1), DataFromXML, sPath, sPathProperties)
  102.     End If
  103. Next iStep
  104. End Sub