<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Loading and parsing XML files from the file system
Our XML files are in a subdirectory called 'partonopeus'. We load the os library and use its listdir() method to verify the contents of that directory.
Step1:  We create a dictionary to hold our input files, using the single-letter filename before the '.xml' extension as the key and the file itself as the value. The lxml library that we use to parse XML requires that we open the XML file for reading in bytes mode.
Step2:  We load the lxml library and use the .XML() method to parse the file and the .tostring() method to stringify the results so that we can examine them. In Real Life, if we need to manipulate the XML (e.g., to search it with XPath), we would keep it as XML. That is, the tostring() process is used here just to create something human-readable for pedagogical purposes.
<ASSISTANT_TASK:>
Python Code:
import os
os.listdir('partonopeus')
Explanation: Loading and parsing XML files from the file system
Our XML files are in a subdirectory called 'partonopeus'. We load the os library and use its listdir() method to verify the contents of that directory.
End of explanation
inputFiles = {}
for inputFile in os.listdir('partonopeus'):
    siglum = inputFile[0]
    contents = open('partonopeus/' + inputFile,'rb').read()
    inputFiles[siglum] = contents
Explanation: We create a dictionary to hold our input files, using the single-letter filename before the '.xml' extension as the key and the file itself as the value. The lxml library that we use to parse XML requires that we open the XML file for reading in bytes mode.
End of explanation
from lxml import etree
print(etree.tostring(etree.XML(inputFiles['A'])))
Explanation: We load the lxml library and use the .XML() method to parse the file and the .tostring() method to stringify the results so that we can examine them. In Real Life, if we need to manipulate the XML (e.g., to search it with XPath), we would keep it as XML. That is, the tostring() process is used here just to create something human-readable for pedagogical purposes.
End of explanation
<END_TASK>