diff --git a/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Category.php b/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Category.php
index 6a8190c2b76..85f8c0c6f4b 100644
--- a/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Category.php
+++ b/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Category.php
@@ -6,6 +6,7 @@
 namespace Magento\Sitemap\Model\ResourceModel\Catalog;
 
 use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
+use Magento\Framework\App\ObjectManager;
 
 /**
  * Sitemap resource catalog collection model
@@ -45,27 +46,38 @@ class Category extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
      */
     protected $metadataPool;
 
+    /**
+     * @var CategorySelectBuilder
+     */
+    private $categorySelectBuilder;
+
     /**
      * @param \Magento\Framework\Model\ResourceModel\Db\Context $context
      * @param \Magento\Store\Model\StoreManagerInterface $storeManager
      * @param \Magento\Catalog\Model\ResourceModel\Category $categoryResource
      * @param \Magento\Framework\EntityManager\MetadataPool $metadataPool
      * @param string $connectionName
+     * @param CategorySelectBuilder|null $categorySelectBuilder
      */
     public function __construct(
         \Magento\Framework\Model\ResourceModel\Db\Context $context,
         \Magento\Store\Model\StoreManagerInterface $storeManager,
         \Magento\Catalog\Model\ResourceModel\Category $categoryResource,
         \Magento\Framework\EntityManager\MetadataPool $metadataPool,
-        $connectionName = null
+        $connectionName = null,
+        CategorySelectBuilder $categorySelectBuilder = null
     ) {
         $this->_storeManager = $storeManager;
         $this->_categoryResource = $categoryResource;
         parent::__construct($context, $connectionName);
         $this->metadataPool = $metadataPool;
+        $this->categorySelectBuilder = $categorySelectBuilder ??
+            ObjectManager::getInstance()->get(CategorySelectBuilder::class);
     }
 
     /**
+     * Initialize catalog category entity resource model
+     *
      * @return void
      */
     protected function _construct()
@@ -104,23 +116,17 @@ class Category extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
             return false;
         }
 
-        $this->_select = $connection->select()->from(
-            ['e' => $this->getMainTable()],
-            [$this->getIdFieldName(), 'updated_at']
-        )->joinLeft(
-            ['url_rewrite' => $this->getTable('url_rewrite')],
-            'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1'
-            . $connection->quoteInto(' AND url_rewrite.store_id = ?', $store->getId())
-            . $connection->quoteInto(' AND url_rewrite.entity_type = ?', CategoryUrlRewriteGenerator::ENTITY_TYPE),
-            ['url' => 'request_path']
-        )->where(
-            'e.path LIKE ?',
-            $categoryRow['path'] . '/%'
+        $this->_select = $this->categorySelectBuilder->execute(
+            $this->getMainTable(),
+            $this->getIdFieldName(),
+            $store,
+            $categoryRow['path']
         );
 
         $this->_addFilter($storeId, 'is_active', 1);
 
         $query = $connection->query($this->_select);
+
         while ($row = $query->fetch()) {
             $category = $this->_prepareCategory($row);
             $categories[$category->getId()] = $category;
@@ -186,7 +192,6 @@ class Category extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
                 break;
             default:
                 return false;
-                break;
         }
 
         if ($attribute['backend_type'] == 'static') {
diff --git a/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/CategorySelectBuilder.php b/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/CategorySelectBuilder.php
new file mode 100644
index 00000000000..058839c8409
--- /dev/null
+++ b/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/CategorySelectBuilder.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Copyright 2023 Adobe
+ * All Rights Reserved.
+ *
+ * NOTICE: All information contained herein is, and remains
+ * the property of Adobe and its suppliers, if any. The intellectual
+ * and technical concepts contained herein are proprietary to Adobe
+ * and its suppliers and are protected by all applicable intellectual
+ * property laws, including trade secret and copyright laws.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * from Adobe.
+ */
+declare(strict_types=1);
+
+namespace Magento\Sitemap\Model\ResourceModel\Catalog;
+
+use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
+use Magento\Framework\App\ResourceConnection;
+use Magento\Framework\DB\Select;
+use Magento\Store\Api\Data\StoreInterface;
+
+class CategorySelectBuilder
+{
+    /**
+     * @param ResourceConnection $resource
+     */
+    public function __construct(
+        private readonly ResourceConnection $resource
+    ) {
+    }
+
+    /**
+     * Allow to modify a select statement with plugins
+     *
+     * @param string $mainTableName
+     * @param string $idField
+     * @param StoreInterface $store
+     * @param string $path
+     * @return Select
+     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
+     */
+    public function execute(string $mainTableName, string $idField, StoreInterface $store, string $path)
+    {
+        $connection = $this->resource->getConnection();
+
+        return $connection->select()->from(
+            ['e' => $mainTableName],
+            [$idField, 'updated_at']
+        )->joinLeft(
+            ['url_rewrite' => $this->resource->getTableName('url_rewrite')],
+            'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1'
+            . $connection->quoteInto(' AND url_rewrite.store_id = ?', $store->getId())
+            . $connection->quoteInto(' AND url_rewrite.entity_type = ?', CategoryUrlRewriteGenerator::ENTITY_TYPE),
+            ['url' => 'request_path']
+        )->where(
+            'e.path LIKE ?',
+            $path . '/%'
+        );
+    }
+}
diff --git a/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Product.php b/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Product.php
index 41347263839..f1771ee7968 100644
--- a/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Product.php
+++ b/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/Product.php
@@ -19,7 +19,7 @@ use Magento\Store\Model\Store;
  */
 class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
 {
-    const NOT_SELECTED_IMAGE = 'no_selection';
+    public const NOT_SELECTED_IMAGE = 'no_selection';
 
     /**
      * Collection Zend Db select
@@ -42,8 +42,6 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
     protected $mediaGalleryReadHandler;
 
     /**
-     * Sitemap data
-     *
      * @var \Magento\Sitemap\Helper\Data
      */
     protected $_sitemapData = null;
@@ -77,6 +75,7 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
     /**
      * @var \Magento\Catalog\Model\Product\Media\Config
      * @deprecated 100.2.0 unused
+     * @see getProductImageUrl
      */
     protected $_mediaConfig;
 
@@ -85,6 +84,11 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
      */
     private $imageUrlBuilder;
 
+    /**
+     * @var ProductSelectBuilder
+     */
+    private $productSelectBuilder;
+
     /**
      * Product constructor.
      *
@@ -102,6 +106,7 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
      * @param \Magento\Catalog\Helper\Image $catalogImageHelper
      * @param \Magento\Framework\App\Config\ScopeConfigInterface|null $scopeConfig
      * @param UrlBuilder $urlBuilder
+     * @param ProductSelectBuilder $productSelectBuilder
      * @SuppressWarnings(PHPMD.ExcessiveParameterList)
      * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
@@ -119,7 +124,8 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
         \Magento\Catalog\Model\Product $productModel = null,
         \Magento\Catalog\Helper\Image $catalogImageHelper = null,
         \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig = null,
-        UrlBuilder $urlBuilder = null
+        UrlBuilder $urlBuilder = null,
+        ProductSelectBuilder $productSelectBuilder = null
     ) {
         $this->_productResource = $productResource;
         $this->_storeManager = $storeManager;
@@ -130,6 +136,8 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
         $this->_mediaConfig = $mediaConfig;
         $this->_sitemapData = $sitemapData;
         $this->imageUrlBuilder = $urlBuilder ?? ObjectManager::getInstance()->get(UrlBuilder::class);
+        $this->productSelectBuilder = $productSelectBuilder ??
+            ObjectManager::getInstance()->get(ProductSelectBuilder::class);
 
         parent::__construct($context, $connectionName);
     }
@@ -287,23 +295,12 @@ class Product extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
         }
 
         $connection = $this->getConnection();
-        $this->_select = $connection->select()->from(
-            ['e' => $this->getMainTable()],
-            [$this->getIdFieldName(), $this->_productResource->getLinkField(), 'updated_at']
-        )->joinInner(
-            ['w' => $this->getTable('catalog_product_website')],
-            'e.entity_id = w.product_id',
-            []
-        )->joinLeft(
-            ['url_rewrite' => $this->getTable('url_rewrite')],
-            'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1'
-            . ' AND url_rewrite.metadata IS NULL'
-            . $connection->quoteInto(' AND url_rewrite.store_id = ?', $store->getId())
-            . $connection->quoteInto(' AND url_rewrite.entity_type = ?', ProductUrlRewriteGenerator::ENTITY_TYPE),
-            ['url' => 'request_path']
-        )->where(
-            'w.website_id = ?',
-            $store->getWebsiteId()
+
+        $this->_select = $this->productSelectBuilder->execute(
+            $this->getMainTable(),
+            $this->getIdFieldName(),
+            $this->_productResource->getLinkField(),
+            $store
         );
 
         $this->_addFilter($store->getId(), 'visibility', $this->_productVisibility->getVisibleInSiteIds(), 'in');
diff --git a/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/ProductSelectBuilder.php b/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/ProductSelectBuilder.php
new file mode 100644
index 00000000000..0dc2682a0fa
--- /dev/null
+++ b/vendor/magento/module-sitemap/Model/ResourceModel/Catalog/ProductSelectBuilder.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Copyright 2023 Adobe
+ * All Rights Reserved.
+ *
+ * NOTICE: All information contained herein is, and remains
+ * the property of Adobe and its suppliers, if any. The intellectual
+ * and technical concepts contained herein are proprietary to Adobe
+ * and its suppliers and are protected by all applicable intellectual
+ * property laws, including trade secret and copyright laws.
+ * Dissemination of this information or reproduction of this material
+ * is strictly forbidden unless prior written permission is obtained
+ * from Adobe.
+ */
+declare(strict_types=1);
+
+namespace Magento\Sitemap\Model\ResourceModel\Catalog;
+
+use Magento\CatalogUrlRewrite\Model\CategoryUrlRewriteGenerator;
+use Magento\CatalogUrlRewrite\Model\ProductUrlRewriteGenerator;
+use Magento\Framework\App\ResourceConnection;
+use Magento\Framework\DB\Select;
+use Magento\Store\Api\Data\StoreInterface;
+
+class ProductSelectBuilder
+{
+    /**
+     * @param ResourceConnection $resource
+     */
+    public function __construct(
+        private readonly ResourceConnection $resource
+    ) {
+    }
+
+    /**
+     * Allow to modify a select statement with plugins
+     *
+     * @param string $mainTableName
+     * @param string $idField
+     * @param string $linkField
+     * @param StoreInterface $store
+     * @return Select
+     */
+    public function execute(
+        string $mainTableName,
+        string $idField,
+        string $linkField,
+        StoreInterface $store
+    ): Select {
+        $connection = $this->resource->getConnection();
+
+        return $connection->select()->from(
+            ['e' => $mainTableName],
+            [$idField, $linkField, 'updated_at']
+        )->joinInner(
+            ['w' => $this->resource->getTableName('catalog_product_website')],
+            'e.entity_id = w.product_id',
+            []
+        )->joinLeft(
+            ['url_rewrite' => $this->resource->getTableName('url_rewrite')],
+            'e.entity_id = url_rewrite.entity_id AND url_rewrite.is_autogenerated = 1'
+            . ' AND url_rewrite.metadata IS NULL'
+            . $connection->quoteInto(' AND url_rewrite.store_id = ?', $store->getId())
+            . $connection->quoteInto(' AND url_rewrite.entity_type = ?', ProductUrlRewriteGenerator::ENTITY_TYPE),
+            ['url' => 'request_path']
+        )->where(
+            'w.website_id = ?',
+            $store->getWebsiteId()
+        );
+    }
+}
