Support self-closing tags, test parse/write cycle is not lossy