cpp: xerces: Generalise document writing to all nodes