api/MarkLogic/MLPHP/SearchResult.php
public function getMetadataQName($elem, $ns = '')
    {
        $result = array();
        // with optional namespace
        if ($ns) {
            foreach ($this->result->getElementsByTagNameNS($ns, $elem) as $e) {
                $val = $e->nodeValue;
                $result[] = $val;
            }
        }
        // without optional namespace
        else {
            foreach ($this->result->getElementsByTagName($elem) as $e) {
                $val = $e->nodeValue;
                $result[] = $val;
            }
        }
        return (count($result) > 0) ? $result  : null;
    }
public function getMetadataQName($elem, $ns = '')
    {
        $result = array();
        // with optional namespace
        if ($ns) {
            foreach ($this->result->getElementsByTagNameNS($ns, $elem) as $e) {
                $val = $e->nodeValue;
                $result[] = $val;
            }
        }
        // without optional namespace
        else {
            foreach ($this->result->getElementsByTagName($elem) as $e) {
                $val = $e->nodeValue;
                $result[] = $val;
            }
        }
        return (count($result) > 0) ? $result  : null;
    }
Get an array metadata value(s) based on a qname element and namespace.

@param mixed $elem The qname element name.
@param mixed $ns The qname namespace (optional).
@return array The array of metadata value(s) associated with the qname.