Insert a literal newline into the XML output of the specified stream, with formatting depending on the specified state, and update state accordingly. Return the stream. If following a call to openElement, or addAttribute, add a closing > to the opened tag.