Riemann sum without the boundary sets Let $X\in \mathbb R^m$ be J-measurable set and $f:X\to \mathbb R$ an integrable function. I would like to prove this Riemann sum formula still holds

$$\int _Xf(x)dx=\lim_{|D|\to 0}\Sigma(f;D^*)$$

even we take only the sets of the decomposition $D^*$  which don't have common points with the boundary of $X$.
Remarks:
We define the Riemann sum as $\Sigma (f;D^*)=\sum_{i=1}^kf(\xi_i)volX_i$, where the decomposition $D^*=\{X_1,\ldots,X_k\}$ and $X_i$ are J-measurable with $\xi_i\in X_i$.
I want to prove if we restrict to only the $X_i$ without any point in commum with the boundary of $X$, then we can use only these sets in the Riemann sum getting the same result as if we would sum every $X_i$.
I can see this intuitively, but I don't know how we can prove it formally.
 A: Let $R$ be a rectangle such that $X \subset R$. Since $X$ is $J-$measurable, the boundary $\partial X$ has measure zero.  The integral over $X$ is given by
$$\int_X f = \int_R f \,1_{X}$$
where the$1_X$ denotes the indicator function.
$$1_X(x) = \begin{cases}1, \,\,\,\, x \in X,\\ 0, \,\,\,\, x \notin X \end{cases}.$$
Since $f \, 1_X = f \, 1_{X \setminus \partial X}$ except possibly on the measure zero set $\partial X$, we have
$$\tag{1}\int_X f = \int_R f 1_X = \int_R f 1_{X \setminus \partial X}.$$
Now consider Riemann sums for the integral on the right-hand side of (1). If a sub-rectangle of a partition $P$ intersects the boundary, choose a point on the boundary $\partial X$ as the intermediate point where the integrand $f \, 1_{X \setminus \partial X}$ is evaluated.  Since the integrand has $0$ value at this point, there will be no contribution to the sum from sub-rectangles that intersect the boundary. However, as $|P| \to 0$ such Riemann sums converge to the integral on the right-hand side of (1) and consequently to the integral on the left-hand side.
To arrive at (1) we use the fact that if $h = f-g = 0$ except on a set $E$ of measure $0$, then $\int_R h = \int_R(f-g) = \int_R f - \int_R g = 0.$ This is relatively easy prove even in the context of Riemann integration.  Given any partition P of $R$, every sub-rectangle $S$ has non-zero content and must contain a point $x$ where $h(x) = 0$. Hence, upper and lower Riemann sums satisfy
$$L(P,h) \leqslant 0 \leqslant U(P,h) $$
and
$$\int_R h = \sup_P L(P,h)  \leqslant 0 \leqslant \inf_P U(P,h) = \int_R h \\ \implies \int_R h = 0$$
