function is_namespaced($ns, $attribute = false)
{
// Atom vs. RSS
if ($this->is_atom()) {
$root = array('', 'atom');
} else {
$root = array('', 'rss');
}
// RDF formats; namespaced in attribs but not in elements
if (!$attribute and $this->is_rdf()) {
$root[] = 'rdf';
}
return !in_array(strtolower($ns), $root);
}