Identify what you want to set to urlmedia to when the attribute is not present, for this I'll cal it defaultUrl.
Xnamespace media=http://search.yahoo.com/mrss/;
XDocument rss=Xdocument.Load(myurl);
var myItems=from item in rss.Descendants("item")
let um = item.Element(media+"content").Attribute("url")
select new
{
title=item.Element("title").Value,
urlmedia= (um != null) ? um.Value : defaultUrl
}
I.e. check for null before getting the value (and the let clause is useful here to avoid repeating the item.Element... sub-expression.
Richard