refactoring: added XmlWrapper to avoid global functions.