[jQuery] How do I return false if no elements found using XPath?

[jQuery] How do I return false if no elements found using XPath?


I am trying to find a particular parentElement without knowing the ID.
If not I need to find a different element. SO:
var parentXpath = "div[@name=contentElement][@id="+obj.id+"]/..
[@name=contentElement]";
if (*noobjectfound*) {
find new object
}
How can I do this?