Fix: Generated XML Tree

The earlier commit wasn't generating a proper XML tree (badly or non closed tags).