Extended XML parser

Pending changes from last commit.