Improved config's XML output algorithm