Since Windows XP logons are treated as terminal sessions, you can use the terminal services API to log users off. Something like this:
use strict;
use Win32::Lanman;
my $target = 'client01';
Win32::Lanman::WTSLogoffSession($target, 0);
# See also:
# WTSEnumerateSessions()
# WTSQuerySessionInformation()
# WTSDisconnectSession()