throw new DomEx(DomEx.NOT_FOUND_ERR,
throw new DomDOMException(DOMException.NOT_FOUND_ERR,
  public Node removeChild(Node refChild)  {    try      {        DomNode ref = (DomNode) refChild;        if (ref == null || ref.parent != this)          {            throw new DomEx(DomEx.NOT_FOUND_ERR, null, ref, 0);          }        if (readonly && !owner.building)          {            throw new DomEx(DomEx.NO_MODIFICATION_ALLOWED_ERR,                            null, this, 0);          }                for (DomNode child = first; child != null; child = child.next)          {            if (child == ref)              {                if (reportMutations)                  {                    removalEvent(null, child);                  }                length--;                if (ref.previous != null)                  {                    ref.previous.next = ref.next;                  }                if (ref.next != null)                  {                    ref.next.previous = ref.previous;                  }                if (first == ref)                  {                    first = ref.next;                  }                if (last == ref)                  {                    last = ref.previous;                  }                // renumber indices                int i = 0;                for (DomNode ctx = first; ctx != null; ctx = ctx.next)                  {                    ctx.index = i++;                  }                ref.parent = null;                ref.setDepth(0);                ref.index = 0;                ref.previous = null;                ref.next = null;                                return ref;              }          }        throw new DomEx(DomEx.NOT_FOUND_ERR,                        "that's no child of mine", refChild, 0);      }    catch (ClassCastException e)      {        throw new DomEx(DomEx.WRONG_DOCUMENT_ERR,                        null, refChild, 0);      }  }