When calling WSDL::toDom() on a WSDL object which was created from a file which imports several other WSDL files with different namespaces, all definition objects are thrown together in the resulting XML structure. For example, two message definitions ns1:msg and ns2:msg are then specified as tns:msg.
The WSDL handling should probably be split out and improved to the point where reading a document with attached WSDL imports and XSD includes will return the connected set of definitions, and writing this document will preserve these connections.
A particular use case for me would be identifying the files related to a service description and rewriting the URLs for all imports and includes.