'use strict';

var ltx = require('ltx')
  , fs = require('fs')
  , Event = require('events').EventEmitter

exports.getStanza = function(file) {
    var stanza = fs.readFileSync(__dirname + '/resources/' + file)
    var stanzaStr = stanza.toString()
        .replace(/[\n\r]/g, '')
        .replace(/>\s{1,}/g, '>')
    return ltx.parse(stanzaStr)
}

var XmppEventer = function() {}
XmppEventer.prototype = new Event()
XmppEventer.prototype.send = function(stanza) {
    this.emit('stanza', stanza.root())
}

var SocketEventer = function() {}
SocketEventer.prototype = new Event()
SocketEventer.prototype.send = function(event, data, callback) {
    this.emit(event, data, callback)
}

exports.XmppEventer = XmppEventer
exports.SocketEventer = SocketEventer
@@ -499,16 +499,50 @@
 oot())%0A%7D
+%0Aexports.XmppEventer = XmppEventer
 %0A%0Avar So
@@ -711,25 +711,24 @@
 back)%0A%7D%0A
-%0A
 exports.
 XmppEven
@@ -711,36 +711,38 @@
 back)%0A%7D%0Aexports.
-Xmpp
+Socket
 Eventer = XmppEv
@@ -735,28 +735,30 @@
 enter = 
-Xmpp
+Socket
 Eventer%0A
 exports.
@@ -749,24 +749,25 @@
 Eventer%0A
+%0A
 exports.
 SocketEv
@@ -762,33 +762,68 @@
 rts.
-SocketEventer = SocketEventer
+failingItemParser = function() %7B%0A    throw new Error('FAIL!')%0A%7D%0A

Use newer helper.js