def locate(path)
      return [self] if path.nil?
      found = []
      pa = path.split('/')
      if '*' == path[0]
        # a bit of a hack but it allows self to be checked as well
        e = Element.new('')
        e << self
        e.alocate(pa, found)
      else
        alocate(pa, found)
      end
      found
    end
def locate(path)
      return [self] if path.nil?
      found = []
      pa = path.split('/')
      if '*' == path[0]
        # a bit of a hack but it allows self to be checked as well
        e = Element.new('')
        e << self
        e.alocate(pa, found)
      else
        alocate(pa, found)
      end
      found
    end
Returns an array of Nodes or Strings that correspond to the locations
 specified by the path parameter. The path parameter describes the path
 to the return values which can be either nodes in the XML or
 attributes. The path is a relative description. There are similarities
 between the locate() method and XPath but locate does not follow the
 same rules as XPath. The syntax is meant to be simpler and more Ruby
 like.

 Like XPath the path delimiters are the slash (/) character. The path is
 split on the delimiter and each element of the path then describes the
 child of the current Element to traverse.

 Attributes are specified with an @ prefix.

 Each element name in the path can be followed by a bracket expression
 that narrows the paths to traverse. Supported expressions are numbers
 with a preceeding qualifier. Qualifiers are -, +, <, and >. The +
 qualifier is the default. A - qualifier indicates the index begins at
 the end of the children just like for Ruby Arrays. The < and >
 qualifiers indicates all elements either less than or greater than
 should be matched. Note that unlike XPath, the element index starts at 0
 similar to Ruby be contrary to XPath.

 Element names can also be wildcard characters. A * indicates any decendent should be followed. A ? indicates any
 single Element can match the wildcard. A ^ character followed by the name of a Class will match any node of the
 specified class. Valid class names are Element, Comment, String (or Text), CData, DocType.

 Examples are:
 * <code>element.locate("Family/Pete/*")</code> returns all children of the Pete Element.
 * <code>element.locate("Family/?[1]")</code> returns the first element in the Family Element.
 * <code>element.locate("Family/?[<3]")</code> returns the first 3 elements in the Family Element.
 * <code>element.locate("Family/?[@age]")</code> returns the elements with an age attribute defined in the Family Element.
 * <code>element.locate("Family/Kid[@age]")</code> returns the Kid elements with an age attribute defined in the Family Element.
 * <code>element.locate("Family/?[@age=32]")</code> returns the elements with an age attribute equal to 32 in the Family Element.
 * <code>element.locate("Family/Kid[@age=32]")</code> returns the Kid elements with an age attribute equal to 32 in the Family Element.
 * <code>element.locate("Family/?/@age")</code> returns the arg attribute for each child in the Family Element.
 * <code>element.locate("Family/*/@type")</code> returns the type attribute value for decendents of the Family.
 * <code>element.locate("Family/^Comment")</code> returns any comments that are a child of Family.

 - +path+ [String] path to the Nodes to locate