was my first try. However, if there are multiple mixed nodes, the code will grab all the way to the "/>" first, even though the first node may end in "</Instance>. That is to say, it may grab 2 or more nodes, rather than just one.

- The code:

while($tag =~ m#<Instance.+?(?:/>||/Instance>)#mi)

This attempt will grab a node with no node data successfully (i.e., <Instance id="1" name="node_1" />), but will only grab the node information up to the node data, if it exists. For example, parsing

<Instance id="2" name="node_2">Node data</Instance>

will only grab

<Instance id="2" name="node_2"> with a remainder of Node data</Instance>

Note: I did try setting the or using a single pipe in the non-saved match {i.e., (?:/>|/Instance>) } However, this produced no matches.

I've tried a few other solutions as well with no luck. Any suggestions would be appreciated.