def findElementByAttributeValue( elements, attribute_name, attribute_value )
      element = nil
      if elements
          if elements.is_a?( REXML::Element )
            elements.each_element_with_attribute( attribute_name, attribute_value ) { |e|  element = e }
          elsif elements.is_a?( Array )
            elements.each{ |e|
              if e.is_a?( REXML::Element ) and e.attributes[ attribute_name ] == attribute_value
                element = e
              end
            }
          end
      end
      element
   end
def findElementByAttributeValue( elements, attribute_name, attribute_value )
      element = nil
      if elements
          if elements.is_a?( REXML::Element )
            elements.each_element_with_attribute( attribute_name, attribute_value ) { |e|  element = e }
          elsif elements.is_a?( Array )
            elements.each{ |e|
              if e.is_a?( REXML::Element ) and e.attributes[ attribute_name ] == attribute_value
                element = e
              end
            }
          end
      end
      element
   end
Returns the first XML sub-element with the specified attribute value.