def create_parser
      @parser = Parser.new.tap do |parser|
        parser.stream_open {|node| @nodes.push(node) }
        parser.stream_close { close_connection }
        parser.stanza {|node| @nodes.push(node) }
      end
    end
def create_parser
      @parser = Parser.new.tap do |parser|
        parser.stream_open {|node| @nodes.push(node) }
        parser.stream_close { close_connection }
        parser.stanza {|node| @nodes.push(node) }
      end
    end
Initialize a new XML parser for this connection. This is called when the
 stream is first connected as well as for stream restarts during
 negotiation. Subclasses can override this method to provide a different
 type of parser (e.g. HTTP).

 Returns nothing.