def lookupQueryByName( name, dbid=nil  )
      getSchema(dbid) if dbid
      if @queries
         @queries.each_element_with_attribute( "id" ){|q|
            if q.name == "query" and q.elements["qyname"].text.downcase == name.downcase
               return q
            end
         }
      end
      nil
   end
def lookupQueryByName( name, dbid=nil  )
      getSchema(dbid) if dbid
      if @queries
         @queries.each_element_with_attribute( "id" ){|q|
            if q.name == "query" and q.elements["qyname"].text.downcase == name.downcase
               return q
            end
         }
      end
      nil
   end
Returns the XML element for a query with the specified ID.
 getSchema() or doQuery()  should be called before this if you don't supply the dbid.