Resolved issues related to tag parsing (terminal XML tags were being erroneously identified)