private void printContentRange(Writer out, List<Content> content, int start, int end, int level, NamespaceStack namespaces)
    throws IOException {
    boolean firstNode; // Flag for 1st node in content
    Object next;       // Node we're about to print
    int first, index;  // Indexes into the list of content

    index = start;
    while (index < end) {
      firstNode = index == start;
      next = content.get(index);

      //
      // Handle consecutive CDATA, Text, and EntityRef nodes all at once
      //
      if ((next instanceof Text) || (next instanceof EntityRef)) {
        first = skipLeadingWhite(content, index);
        // Set index to next node for loop
        index = nextNonText(content, first);

        // If it's not all whitespace - print it!
        if (first < index) {
          if (!firstNode) {
            newline(out);
          }
          indent(out, level);
          printTextRange(out, content, first, index);
        }
        continue;
      }

      //
      // Handle other nodes
      //
      if (!firstNode) {
        newline(out);
      }

      indent(out, level);

      if (next instanceof Element) {
        printElement(out, (Element)next, level, namespaces);
      }
      else {
        // XXX if we get here then we have a illegal content, for
        //     now we'll just ignore it (probably should throw
        //     a exception)
      }

      index++;
    } /* while */
  }
private void printContentRange(Writer out, List<Content> content, int start, int end, int level, NamespaceStack namespaces)