I have a text file that contains the following elements:

<PersonList><Person title="Miss" firstname="Joan" surname="Collins" age="62"/><Person title="Mr" firstname="Jack" surname="Smith" age="35"/></PersonList>

I need to retrieve the elements an put them in an XML dom, which i have done like so:

Public Function Retrieve(filename) As Collection

Dim Filenum As Integer
Set Retrieve = New Collection

'Get the file number of a free file to read the file's contents to
Filenum = FreeFile()

'Open the file
Open filename For Input As #Filenum

Dim strXML As String

'1. get the contents of this file and put it in a xml dom

Do While Not EOF(Filenum)
Line Input #Filenum, strXML
Debug.Print strXML
Loop

Close #Filenum


End Function

Now I want to be able to loop through each element and retrieve the attribute details i.e Joan, Collins etc. Does anyone know how to create a piece of code that can identify the number of elements in the xml dom or would i have to identify each element via say the Person tag and split the strings?

Thanks

Madeline