class StaxLocation implements Location {

    private final javax.xml.stream.Location location;

    public static Location getLocation(Exception e) {
        return toLocation(e instanceof XMLStreamException xe ? xe.getLocation() : null);
    }

    public static Location toLocation(javax.xml.stream.Location location) {
        return location != null ? new StaxLocation(location) : null;
    }

    public static String getMessage(Exception e) {<FILL_FUNCTION_BODY>}

    public StaxLocation(javax.xml.stream.Location location) {
        this.location = location;
    }

    @Override
    public int getLineNumber() {
        return location.getLineNumber();
    }

    @Override
    public int getColumnNumber() {
        return location.getColumnNumber();
    }

    @Override
    public int getCharacterOffset() {
        return location.getCharacterOffset();
    }

    @Override
    public String getPublicId() {
        return location.getPublicId();
    }

    @Override
    public String getSystemId() {
        return location.getSystemId();
    }
}

        String message = e.getMessage();
        if (e instanceof XMLStreamException xe && xe.getLocation() != null) {
            int idx = message.indexOf("\nMessage: ");
            if (idx >= 0) {
                return message.substring(idx + "\nMessage: ".length());
            }
        }
        return message;
    
<no_super_class>