def self.from_xml(xml,flickr=nil)
att = xml.attributes
psid = att['id']
set = flickr.photoset_cache_lookup(psid) if flickr
set ||= Flickr::PhotoSet.new(psid,flickr)
set.secret = att['secret']
set.owner = att['owner']
set.url = att['url']
set.server = att['server'].to_i
set.primary_id = att['primary'].to_i
set.photo_count = att['photos'].to_i
set.title = xml.elements['title'].text if xml.elements['title']
set.description = xml.elements['description'].text if
xml.elements['description']
if xml.elements['photo']
set.clear
xml.elements.each('photo') do |el|
set.<<(Flickr::Photo.from_xml(el,flickr),true)
end
end
flickr.photoset_cache_store(set) if flickr
return set
end