                         iq = @makeIq("result", stanza.attrs.to, stanza.attrs.from, id)
                             .cnode(queryEl)
                         @emit "stanza", iq.root()
-                    if stanza.getChild("query", "http://jabber.org/protocol/disco#items")? and stanza.attrs.to of @disco.items
+                    if stanza.getChild("query", NS.DISCO_ITEMS)? and stanza.attrs.to of @disco.items
                         items = @disco.items[stanza.attrs.to]
-                        queryEl = new ltx.Element("query", xmlns: "http://jabber.org/protocol/disco#items")
+                        queryEl = new ltx.Element("query", xmlns: NS.DISCO_ITEMS)
                         for item in items
                             queryEl.c "item", item
                         iq = @makeIq("result", stanza.attrs.to, stanza.attrs.from, id)


                # Handle disco queries
                if type is "get"
                    if stanza.getChild("query", "http://jabber.org/protocol/disco#info")? and stanza.attrs.to of @disco.info
                        info = @disco.info[stanza.attrs.to]
                        queryEl = new ltx.Element("query", xmlns: "http://jabber.org/protocol/disco#info")
                        for identity in info.identities
                            queryEl.c "identity", identity
                        for feature in info.features

        for feature in qEl.getChildren "feature"
            disco.features.push feature.attrs.var

        xEl = qEl.getChild("x", NS.DATA)
        if xEl?
            disco.form = @parseForm xEl

        return disco

    # Prepare a disco#items stanza.
    # @return [ltx.Element] Stanza with `<query/>` as active sub-Element
    makeDiscoItemsIq: (from, to, id) ->
        return @makeIq("get", from, to, id)
            .c("query", xmlns: NS.DISCO_ITEMS)

    # Prepare a PubSub "set" stanza.
    # @return [ltx.Element] Stanza with `<pubsub/>` as active sub-Element
    makePubsubSetIq: (from, to, id) ->
        return @makeIq("set", from, to, id)
            .c("pubsub", xmlns: NS.PUBSUB)

    # Run an asynchronous test safely.
    # @param [ltx.Element] stanza Stanza to send to the buddycloud server
