XML parsing

Hi,

I’m new to webMethods and have been trying to implement sample flow services. I’m trying to parse an XML to get all the tag names contained in the XML to a string list. I’m assuming that the flow will not know the number of tags contained in the document.
This is how I went ahead with the solution…
[HTML] getFile
StringtoXMLNode
Repeat (loop1)
getXMLNodeIterator
Repeat(loop2)
getNextXMLNode
Branch(on next/name)
if next node is null then exit loop2
else append tag name to string list, map the current node to next node[/HTML]

Now the problem i’m facing… For this sample xml,

[HTML]<?xml version="1.0"?>


1
2


3
4


[/HTML]
the expected output is

Step1
Step11
Variable1
Variable2
Step12
Variable3
Variable4

instead i get

Step1
Step11
Step12
Variable3
Variable4

The same holds good if i increase the number of tags in the same level. the iterator only picks up the inside tag names of the last tag in the same level. What am i doing wrong? Hope I have not been confusing in this post.

Thanks.