Hello again,
 
a) This is my Java class:
 
package org.Interface;
import java.net.InetAddress;
/**
 *
 * @author HP
 */
public class Adress {
   
    private static String adress="";

    public Adress (){}
   
    public static String getAdress() {
        try {
            InetAddress iadr = InetAddress.getLocalHost();        
            adress = iadr.getHostAddress(); 
            
        }catch(Exception exp) {
            exp.printStackTrace();
        }

 return adress;
}

}
b) Yes I run from command line, like this:
 
C:\CMR>java -classpath "C:\Program Files\saxonpe9-2-0-6j\saxon9pe.jar;C:\Program Files\saxonpe9-2-0-6j" net.sf.saxon.Query -s:"C:\CMR\SB\dcu\abc.xmi" -q:"C:\CMR\SB\dcu\Transformer_XMI_XML.xquery"
 
I put the query "Transformer_XMI_XML.xquery" in "C:\CMR\SB\dcu\"
I put the class "Adress" in "C:\CMR\src\..\org.Interface"
 
I put the class which does the transformation "XQClass.java" in "C:\CMR\src\..\org.Interface"
with this transformation method:
 
public void XQtransform(String source,String output) throws XQException, XPathException, IOException {
        try {
            final Configuration config = new Configuration();
            final StaticQueryContext sqc = new StaticQueryContext(config);
            sqc.setBaseURI(new File(source).toURI().toString());
            final XQueryExpression exp = sqc.compileQuery(new FileReader("C:/CMR/SB/dcu/Transformer_XMI_XML.xquery"));
            final DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
            Properties props = new Properties();
            dynamicContext.setContextItem(sqc.buildDocument(new StreamSource(source)));
 
            final SequenceIterator iter = exp.iterator(dynamicContext);
            props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
            props.setProperty(OutputKeys.INDENT, "yes");
 
            FileOutputStream otf = new FileOutputStream(output);
            QueryResult.serializeSequence(iter, config, otf, props);
            otf.close();

            } catch (FileNotFoundException ex) {
            Logger.getLogger(XQJEx.class.getName()).log(Level.SEVERE, null, ex);
        }
}
 
 Thank you very much for your help.