This is because this is a forward-only writer and the start tags are already finished. There is no going back to add more attributes later, there is no place to put attr2. This is exactly how it is supposed to work.