Build xml for database tables