private Stanza buildResponse(IQStanza stanza, Entity from, String commandNode, String sessionId,
final String status, XMLElement result,
List<Note> notes, boolean isPrevAllowed, boolean isNextAllowed) {
final StanzaBuilder iqStanza = StanzaBuilder.createIQStanza(null, from, IQStanzaType.RESULT, stanza.getID());
iqStanza.startInnerElement("command");
iqStanza.declareNamespace("", NamespaceURIs.XEP0050_ADHOC_COMMANDS);
iqStanza.addAttribute("node", commandNode);
iqStanza.addAttribute("sessionid", sessionId);
iqStanza.addAttribute("status", status);
if (notes != null && notes.size() > 0) {
for (Note note : notes) {