code refactored. deprecations added. test added
TODO: use xml parser that will not omit comments