improve buildXML()

Code cleanup and little performance enhancement:
  - defaults to array() using "or": avoid if-assignement