Javascript implementation of the classic XMLWriter class