xml serialize io w3c dom w3c dom Node xml sax xml sax xml sax SAXException textserializer basemarkupserializer textserializer outputformat method.text setoutputformat outputformat format super.setoutputformat format format outputformat method.text startelement namespaceuri localname rawname attrs saxexception startelement rawname localname rawname namespaceuri localname rawname saxexception rawname localname rawname startelement tagname attrs saxexception preservespace elementstate getelementstate isdocumentstate _started startdocument tagname preservespace state.preservespace enterelementstate tagname preservespace except saxexception except tagname saxexception endelementio tagname except saxexception except endelementio tagname elementstate getelementstate leaveelementstate state.empty isdocumentstate _printer.flush processinginstructionio target code comment text comment chars start length characters chars start length saxexception elementstate content state.docdata state.incdata printtext chars start length except saxexception except characters text unescaped elementstate content state.docdata state.incdata printtext text startdocument roottagname _printer.leavedtd _started serializepreroot serializeelement elem node child elementstate preservespace tagname tagname elem.gettagname getelementstate isdocumentstate _started startdocument tagname preservespace state.preservespace elem.haschildnodes enterelementstate tagname preservespace child elem.getfirstchild child serializenode child child child.getnextsibling endelementio tagname isdocumentstate state.empty serializenode node node node.getnodetype node.text_node text text node.getnodevalue text characters node.getnodevalue node.cdata_section_node text text node.getnodevalue text characters node.getnodevalue node.comment_node node.entity_reference_node node.processing_instruction_node node.element_node serializeelement node node.document_node node.document_fragment_node node child child node.getfirstchild child serializenode child child child.getnextsibling elementstate content elementstate getelementstate isdocumentstate state.empty state.empty ch