X-rays from jet-driving protostars and T Tauri stars