I know I've seen this exact getNewElementStart code before in other parsers, could you extract and reuse?