Support xml namespacing

Provides support for xml namespacing + does some minor refactoring (missing requirement and some minor pep8 refactoring)