code/Debug/Model/Service.php
public function getFileUpdatesWithHandle($handle, $storeId, $area)
    {
        /** @var array $updateFiles */
        $updateFiles = Mage::helper('sheep_debug')->getLayoutUpdatesFiles($storeId, $area);

        /* @var $designPackage Mage_Core_Model_Design_Package */
        $designPackage = Mage::getModel('core/design_package');
        $designPackage->setStore($storeId);
        $designPackage->setArea($area);
        $designPackageName = $designPackage->getPackageName();
        $layoutTheme = $designPackage->getTheme('layout');

        // search handle in all layout files registered for this area, package name and theme
        $handleFiles = array();
        foreach ($updateFiles as $file) {
            $filename = $designPackage->getLayoutFilename($file, array(
                '_area'    => $area,
                '_package' => $designPackageName,
                '_theme'   => $layoutTheme
            ));

            if (!is_readable($filename)) {
                continue;
            }

            /** @var SimpleXMLElement $fileXml */
            $fileXml = $this->loadXmlFile($filename);
            if ($fileXml === false) {
                continue;
            }

            $relativeFilename = str_replace($this->getBaseDir(), '', $filename);

            /** @var SimpleXMLElement[] $result */
            $results = $fileXml->xpath("/layout/{$handle}");
            if ($results) {
                $handleFiles[$relativeFilename] = array();
                /** @var SimpleXMLElement $result */
                foreach ($results as $result) {
                    $handleFiles[$relativeFilename][] = $result->asXML();
                }
            }
        }

        return $handleFiles;
    }
public function getFileUpdatesWithHandle($handle, $storeId, $area)
    {
        /** @var array $updateFiles */
        $updateFiles = Mage::helper('sheep_debug')->getLayoutUpdatesFiles($storeId, $area);

        /* @var $designPackage Mage_Core_Model_Design_Package */
        $designPackage = Mage::getModel('core/design_package');
        $designPackage->setStore($storeId);
        $designPackage->setArea($area);
        $designPackageName = $designPackage->getPackageName();
        $layoutTheme = $designPackage->getTheme('layout');

        // search handle in all layout files registered for this area, package name and theme
        $handleFiles = array();
        foreach ($updateFiles as $file) {
            $filename = $designPackage->getLayoutFilename($file, array(
                '_area'    => $area,
                '_package' => $designPackageName,
                '_theme'   => $layoutTheme
            ));

            if (!is_readable($filename)) {
                continue;
            }

            /** @var SimpleXMLElement $fileXml */
            $fileXml = $this->loadXmlFile($filename);
            if ($fileXml === false) {
                continue;
            }

            $relativeFilename = str_replace($this->getBaseDir(), '', $filename);

            /** @var SimpleXMLElement[] $result */
            $results = $fileXml->xpath("/layout/{$handle}");
            if ($results) {
                $handleFiles[$relativeFilename] = array();
                /** @var SimpleXMLElement $result */
                foreach ($results as $result) {
                    $handleFiles[$relativeFilename][] = $result->asXML();
                }
            }
        }

        return $handleFiles;
    }
Returns layout files that have updates for specified handle

@param string $handle
@param int    $storeId
@param string $area
@return array