I still don't understand quite what it is you want to get. An example of the expected output would definitely help.
Some comments though, maybe they will put you on the right track:
In reply to Re^3: DTD and xml module
by mirod
in thread DTD and xml module
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |