code: def test_XMLWriter(tmp_path: Path):
      lyrics_seq = ["P", "a", "—", "b"]
      notes_seq = [0, 20, 21, 22]
      segs_seq = [(0, 1), (1, 2), (2, 3), (3, 3.1)]
      tempo = 60
      val = lyrics_seq, notes_seq, segs_seq, tempo
      p = tmp_path / "dummy4.scp"
      with XMLWriter(tmp_path, p) as writer:
          writer["abc"] = val
  
      reader = XMLReader(p)
      val = reader["abc"]
      assert len(val) == 2
      assert val[0] == 60
      notes_list = [
          NOTE("P", 0, 0, 1),
          NOTE("a", 20, 1, 2),
          NOTE("—", 21, 2, 3),
          NOTE("b", 22, 3, 3.125),
      ]
      for i in range(len(val[1])):
          assert val[1][i].st == notes_list[i].st
          assert val[1][i].et == notes_list[i].et
          assert val[1][i].lyric == notes_list[i].lyric
          assert val[1][i].midi == notes_list[i].midi
  
file_path: espnet/test/espnet2/fileio/test_score_scp.py
imports: import json
  from pathlib import Path
  import miditoolkit
  import miditoolkit.midi.containers
  import music21
  import numpy
  from espnet2.fileio.score_scp import NOTE, MIDReader, SingingScoreReader, SingingScoreWriter, XMLReader, XMLWriter
label_desc: Use image node_id 2 for calling a global function with example usage: test_XMLWriter(tmp_path) without return types