Move the XML parser function to a module that does not import Django.
So it can be used by the client code.