Fixed group functions
Fixed xmlns attribute placing

Fixes #634
Fixes #29
Fixes #637