The new lines are almost certainly being written to the file, but I suspect the editor doesn't recognise them as a full line break. Are you using notepad by any chance?
If you append "\r\n" instead of "\n" then it should be visible as a line break in notepad.
However .....
1. You do know you have a buffer overrun in DataBuffer, the amount of text you are writing to is clearly over 100 characters. This could result in some odd behaviour.
2. If you are writing out XML data then the closing tags should be forward not backslash, and you do not close the wpshadowprotectstatus tag.
3. I presume you are deleting the buffer and closing the HFILE handle at the end of it's lifetime?
You should also probably declare the const strings as:
const char* RegID = "10";
const char* mndtime = "10";
const char* resourcetype = "Backup";
const char* ressubtype = "shadowprotect";