Since triangles ABC and XYZ are congruent, their corresponding angles are equal. Thus, we have:
- \( \angle A = \angle X \)
- \( \angle B = \angle Y \)
Given the angles:
- \( \angle A = 5x + 3 \)
- \( \angle B = 3x + 23 \)
- \( \angle X = 7x - 27 \)
Setting \( \angle A \) equal to \( \angle X \):
\[ 5x + 3 = 7x - 27 \]
To solve for \( x \), we first isolate \( x \) on one side:
- Subtract \( 5x \) from both sides:
\[ 3 = 2x - 27 \]
- Add \( 27 \) to both sides:
\[ 30 = 2x \]
- Divide by \( 2 \):
\[ x = 15 \]
Thus, the value of \( x \) is:
\[ \boxed{15} \]