/** @deprecated */
    void addToList(Object toAdd) {
      if (toAdd instanceof Undefined) {
        // Missing argument do nothing...
        return;
      }

      if (toAdd instanceof XMLList) {
        XMLList xmlSrc = (XMLList) toAdd;
        for (int i = 0; i < xmlSrc.length(); i++) {
          this._add((xmlSrc.item(i)).getAnnotation());
        }
      } else if (toAdd instanceof XML) {
        this._add(((XML) (toAdd)).getAnnotation());
      } else if (toAdd instanceof XmlNode) {
        this._add((XmlNode) toAdd);
      }
    }
 void addMatchingChildren(XMLList result, XmlNode.Filter filter) {
   Node node = this.dom;
   NodeList children = node.getChildNodes();
   for (int i = 0; i < children.getLength(); i++) {
     Node childnode = children.item(i);
     XmlNode child = XmlNode.createImpl(childnode);
     if (filter.accept(childnode)) {
       result.addToList(child);
     }
   }
 }