throw err;
    public void dump(PrintStream stream, int indent)    {      StringBuffer b = new StringBuffer();      for (int i = 0; i < indent; ++i)        b.append(' ');      b.append('<');      b.append(getName());      // Dump attributes if there are any.      if (getAttributeCount() > 0)        {          b.append('\n');          Enumeration attNames = getAttributeNames();          while (attNames.hasMoreElements())            {              for (int i = 0; i < indent + 2; ++i)                b.append(' ');              Object attName = attNames.nextElement();              b.append(attName);              b.append('=');              Object attribute = getAttribute(attName);              b.append(attribute);              b.append('\n');            }        }      b.append(">\n");      // Dump element content for leaf elements.      if (isLeaf())        {          for (int i = 0; i < indent + 2; ++i)            b.append(' ');          int start = getStartOffset();          int end = getEndOffset();          b.append('[');          b.append(start);          b.append(',');          b.append(end);          b.append("][");          try            {              b.append(getDocument().getText(start, end - start));            }          catch (BadLocationException ex)            {              AssertionError err = new AssertionError("BadLocationException "                                                      + "must not be thrown "                                                      + "here.");              err.initCause(ex);            }          b.append("]\n");        }      stream.print(b.toString());      // Dump child elements if any.      int count = getElementCount();      for (int i = 0; i < count; ++i)        {          Element el = getElement(i);          if (el instanceof AbstractElement)            ((AbstractElement) el).dump(stream, indent + 2);        }    }