replace_groups (REXML::XPathParser)

    # File rexml/xpath_parser.rb, line 561
      def replace_groups( path, groups=nil )
    			return nil unless path
    			if groups
    				groups.each_index do |index|
    					path[/\#{index}\/] = groups[index]
    				end
    				path
    			else
    				count = 0
    				left = ""
    				args = []

    				while path =~ /(.*?)(?=\|\)/
    					left = left + $1 + "(#{count})"
    					right = $'
    					count += 1
    					path, arg = get_group( right )
    					args << arg
    				end
    				left += path if path and path.length > 0
    				[left, args]
    			end
    		end