prototype of writing to output xml