<!DOCTYPE class>
<class name='Elements'>
   A class which provides filtering of children for Elements, and XPath search support.
  <include name='Enumerable'>
    
  </include>
  <method name='initialize'>
    <argument name='parent'>
      the parent Element
    </argument>
     Constructor 
  </method>
  <method name='[]'>
    <argument name='index'>
      the search parameter.  This is either an Integer, which will be used to find the index'th child Element, or an XPath, which will be used to search for the Element.  NOTE that because of the nature of XPath searches, any element in the connected XML document can be fetched through any other element. 
    </argument>
    <argument default='nil' name='name'>
      optional, and only used in the first argument is an Integer.  In that case, the index'th child Element that has the supplied name will be returned.  Note that the indexes start at 1. 
    </argument>
    <return>
      the first matching Element, or nil if no child matched
    </return>
     Fetches a child element 
  </method>
  <method name='[]='>
    <argument name='index'>
      is used to find a matching element to replace.  See [](). 
    </argument>
    <argument name='element'>
      the element to replace the existing element with 
    </argument>
    <return>
      the previous element; nil if no previous element was found.
    </return>
     Sets an element, replacing any previous matching element.  If no existing element is found ,the element is added. 
  </method>
  <method name='empty'>
    <return>
      true if there are no Element children, false otherwise
    </return>
     
  </method>
  <method name='index'>
    <argument name='element'>
      a child of this Element
    </argument>
    <return>
      the index of the supplied child (starting at 1), or -1 if  the element is not a child 
    </return>
     @return the index of the supplied child (starting at 1), or -1 if  the element is not a child 
  </method>
  <method name='delete'>
    <argument name='element'>
      Either an Element, which is removed directly; an xpath, where the first matching child is removed; or an Integer, where the n'th Element is removed. 
    </argument>
    <return>
      the removed child
    </return>
     Deletes a child Element 
  </method>
  <method name='delete_all'>
    <argument name='xpath'>
      all elements matching this String path are removed. 
    </argument>
    <return>
      an Array of Elements that have been removed
    </return>
     Removes multiple elements 
  </method>
  <method name='add'>
    <argument default='nil' name='element'>
      if supplied, is either an Element, String, or Source (see Element.initialize).  If not supplied or nil, a new, default Element will be constructed 
    </argument>
    <return>
      the added Element
    </return>
     Adds an element 
  </method>
  <alias alias='&lt;&lt;' orig='add'>
    
  </alias>
  <method name='each'>
    <argument default='nil' name='xpath'>
      optional.  If supplied, this is a String XPath, and is used to filter the children, so that only matching children are yielded
    </argument>
    <argument name='block'/>
     Iterates through all of the child Elements, optionally filtering them by a given XPath Only supply the first parameter (and a block).  The second parameter is used internally for recursion. 
  </method>
  <method name='size'/>
  <method name='literalize'>
    <argument name='name'/>
     A private helper method
  </method>
</class>