Formatting XML output of attributes and elements