Can I open two xml document in a function?

I want to make a table according to the conditions. Here, I have a source xml document which contains source data. Then, I want to choose some data according to the conditions to make a table. I had read the WidgetsDemo and now want to store the choosen data to a new xml document so that I can make the table and sort it more convenient. Dose this idea right?