require 'rexml/document'

doc = REXML::Document.new(File.open("feed.rss"))

require 'cgi'
cgi = CGI.new()

item = "1"

item = cgi.params["id"] unless cgi.params["id"].length == 0

Apache.request.content_type = "text/xml"
Apache.request.cache_resp = true
Apache.request.content_encoding = "ISO-8859-1"
Apache.request.send_http_header()

puts "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"

elem = doc.elements["//item[#{item.to_s}]"]

if elem then
    puts elem.to_s
else
    puts "<item />"
end