Function call in wordpress short code handler fails

You’re returning X(), but your X() function appears to be within a class. Presumably the same class as handleShortcode(). So you need to call it the normal way you call functions within a class:

public function handleShortcode($atts) {
    return $this->X();
}

private function X()
{
    return 'Hi world';
}

If you’re not in a class at all, you need to get rid of the private and public:

function handleShortcode($atts) {
    return X();
}

function X()
{
    return 'Hi world';
}