def []( index, name=nil)
      if index.kind_of? Integer
        raise "index (#{index}) must be >= 1" if index < 1
        name = literalize(name) if name
        num = 0
        child = nil
        @element.find { |child|
          child.kind_of? Element and
          (name.nil? ? true : child.has_name?( name )) and 
          (num += 1) == index
        }
      else
        return XPath::first( @element, index )
        #{ |element| 
        #	return element if element.kind_of? Element
        #}
        #return nil
      end
    end
def []( index, name=nil)
      if index.kind_of? Integer
        raise "index (#{index}) must be >= 1" if index < 1
        name = literalize(name) if name
        num = 0
        child = nil
        @element.find { |child|
          child.kind_of? Element and
          (name.nil? ? true : child.has_name?( name )) and 
          (num += 1) == index
        }
      else
        return XPath::first( @element, index )
        #{ |element| 
        #	return element if element.kind_of? Element
        #}
        #return nil
      end
    end
Constructor
 parent:: the parent Element
 Fetches a child element.  Filters only Element children, regardless of
 the XPath match.
 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.  <em>Because
   of the nature of XPath searches, any element in the connected XML
   document can be fetched through any other element.</em>  <b>The
   Integer index is 1-based, not 0-based.</b>  This means that the first
   child element is at index 1, not 0, and the +n+th element is at index
   +n+, not <tt>n-1</tt>.  This is because XPath indexes element children
   starting from 1, not 0, and the indexes should be the same.
 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 again that the indexes start at 1.
 Returns:: the first matching Element, or nil if no child matched
  doc = Document.new '<a><b/><c id="1"/><c id="2"/><d/></a>'
  doc.root.elements[1]       #-> <b/>
  doc.root.elements['c']     #-> <c id="1"/>
  doc.root.elements[2,'c']   #-> <c id="2"/>