Refactored library interface. Made most xmltypes hidden for end-user.