X-ray emission in protostellar jets: comparison between model predictions and observations