Pass the xml variable to the handler methods, instead of calculating it twice.