While writting xml files to the disk with Tiny xml some tag data are not properly written into the file. e.g Sometime child tag is written after parent child (very rare but same code work properly in 99 percent cse)? Is there any way to fix this issue?

a) I am creating multiple Objects of Tiny XML to parse different XML simultaneously.
b) If the two program simultaneously write in same XML is it safe.