private StringBuffer processUssdMessageTags(Queue<Tag> messageTags) { StringBuffer message = new StringBuffer(); while (!messageTags.isEmpty()) { Tag tag = messageTags.poll(); if (tag != null) { message.append(tag.text()); if (!messageTags.isEmpty()) message.append("\n"); } else { return message; } } return message; }