Update xmlgen.php

Added a shorter piece of code to shorten code but still achieve the same thing.