I've messed around with XML grammars before, and I believe you can split up lines into individual fields so that the name becomes an individual item as opposed to a numerated value in the ValueN column. It just takes some playing around. Keep in mind whenever you make a change you're going to have to restart your application server to pick up the new grammar file (or any changes you make to it).
Here is the content of the xml.gm file that tells how to create your own grammars to go about parsing XML files:
if there are duplicate nodes in the xml, then define a new grammar and
associate the new grammar with that xml configuration file instead of using
xml.gm for every xml file. To define a new grammar file for an xml file with
duplicate nodes, use the example below.
In the example above, "servlet" and "init-param" are duplicates. Now a
duplcate node can be disambiguated by its attributes, text value or / and
its children. So each duplicate node and each child that helps in
disambiguate a duplicate have to be present with the following syntax:
All the duplicate nodes have "D" in the first column. If the attributes help
in disambiguation then they are listed separated by commas in the second
column. Otherwise this column can be left empty. If the text value is used in
disambiguation, then the third column should contain 1 (otherwise it can left
empty). If the children help in disambiguation then they are listed separated
by commas in the fourth column. Otherwise this column can be left empty. Note
that if a child helps disambiguating a parent, then it has to appear on a
separate line. If the child unique by itself then its second column contains
a "P" (as it is helping the parent) but it itself is a duplicate, it should
contain a "D" in the second column.
I am having a similar problem with the xml grammar. Were you able to get the grammar file to work with your specific xml document?