public static String determineIndent(String xmlDocument, String xmlFragment) {
        assert xmlDocument != null;
        assert xmlFragment != null;

        Pattern pattern = getPatternForFragment(xmlFragment);
        Matcher matcher = pattern.matcher(xmlDocument);
        if (!matcher.find()) {
            throw new RuntimeException("Could not match");
        }
        return matcher.group(1);
    }
Tries to find the base indent for supplied fragment

@param xmlDocument where to look for the fragment
@param xmlFragment the fragment to look up
@return the found indent
plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/migration/TestCasePatcher.java