You can encapsulate the XML file reading process in a .NET methond, decorated with [LispFunction] attribute, which returns a list of data as ResultBuffer.
Then simply call the .NET lisp function in your lisp routine, as if it is a lisp function. Something like:
[LispFunction("ReadXml")]
public static ReadXlmData(ResultBuffer args)
{
//Read XML file
....
//Build return data
ResultBuffer res=new ResultBuffer(....);
//Fill the result buffer with data from XML file
....
return res;
}
Now, you can call it at command line as if it is a lisp function
Command: (ReadXml)
At command line, you may get something like (xx xx xxx xxx xxx), which is the output ResultBuffer, shown in Acad command line as a list, which depends on how you build the output ResultBuffer in the .NET function.
In your lisp routine, you can get the .NET function's output:
(setq netOutput (ReadXml))
Then you may parse the variable netOutput into a list, based on your lisp routine's need:
(list ...)
As you can see, you simply move the XML data reading process (or even showing a form to allow to pick the XML file, or get other user input) into a .NET method, mark it with [LispFunction()], then plug it into your existing lisp routines. Of cause, you have to make sure the .NET dll is loaded before your lisp routine could use it.