[DO NOT MERGE ] Parse xml for installing .wgt packages

DO NOT MERGE 

I opened the PR so that others can have a look/comment and continue to work on things which are presently blocked by this work, like permission handling for .wgt files. 

@lpereira , @cmarcelo : PTAL 

I have tried to be explicit with the issues in the commit messages.