def replace_apostrophes(input: str) -> str:
    """Treats the presence of apostrophes so it doesn't break the XPath filter expression.

    Args:
        input (str | int): input

    Returns:
        str: XPath filter expression with apostrophes handled.
    """
    if not isinstance(input, str):
        return str(input)

    if "'" in input:
        prefix: str = ""
        elements = input.split("'")
        output = "concat("
        for s in elements:
            output += prefix + "'" + s + "'"
            prefix = ',"\'",'

        output += ")"
        return output

    else:
        return "'" + input + "'"