if (notes != null && notes.size() > 0) {
for (Note note : notes) {
iqStanza.startInnerElement("note");
iqStanza.addAttribute("type", note.getType().name());
if (note.getText() != null) iqStanza.addText(note.getText());
iqStanza.endInnerElement();
}
}
if (isNextAllowed || isPrevAllowed) {
iqStanza.startInnerElement("action");
if (isPrevAllowed) iqStanza.startInnerElement("prev").endInnerElement();