public String getText() {
    if (content.isEmpty()) {
      return "";
    }

    // If we hold only a Text or CDATA, return it directly
    if (content.size() == 1) {
      final Object obj = content.get(0);
      if (obj instanceof Text) {
        return ((Text)obj).getText();
      }
      return "";
    }

    // Else build String up
    final StringBuilder textContent = new StringBuilder();
    boolean hasText = false;

    for (final Object obj : content) {
      if (obj instanceof Text) {
        textContent.append(((Text)obj).getText());
        hasText = true;
      }
    }

    if (!hasText) {
      return "";
    }
    return textContent.toString();
  }
public String getText()