Suponiendo que tienes un XML así:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<User status="Gold">
    <Name>Pepito Pérez</Name>
    <Age>22</Age>
    <History online="true">
        <LastDepositDate>16-08-2015</LastDepositDate>
        <LastWithdrawalDate>06-09-2015</LastWithdrawalDate>
    </History>
</User>
Entonces, creas una clase que Represente a ese XML:
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "User")
@XmlAccessorType(XmlAccessType.FIELD)
public class User {
    @XmlAttribute(name = "status")
    private String status;
    @XmlElement(name = "Name")
    private String name;
    @XmlElement(name = "Age")
    private int age;
    @XmlElement(name="History")
    private History history;
    public User() {
    }
    public User(String name, int age, History history) {
        super();
        this.name = name;
        this.age = age;
        this.history = history;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        this.age = age;
    }
    public History getHistory() {
        return history;
    }
    public void setHistory(History history) {
        this.history = history;
    }
}
@XmlRootElement indica que esa clase representa al tag root del archivo XML. @XmlElement indica que esas propiedades son tags del archivo XML. @XmlAttribute es un atributo del tag (clase) en la que se le declara.
Si te fijas, History tiene sus propios datos, por lo que debe ser otra clase:
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
@XmlAccessorType(XmlAccessType.FIELD)
public class History {
    @XmlElement(name = "LastDepositDate")
    private String lastDepositDate;
    @XmlElement(name = "LastWithdrawalDate")
    private String lastWithdrawalDate;
    @XmlAttribute(name = "online")
    private boolean online;
    public History() {
    }
    public History(String lastDepositDate, String lastWithdrawalDate) {
        super();
        this.lastDepositDate = lastDepositDate;
        this.lastWithdrawalDate = lastWithdrawalDate;
    }
    public String getLastDepositDate() {
        return lastDepositDate;
    }
    public void setLastDepositDate(String lastDepositDate) {
        this.lastDepositDate = lastDepositDate;
    }
    public String getLastWithdrawalDate() {
        return lastWithdrawalDate;
    }
    public void setLastWithdrawalDate(String lastWithdrawalDate) {
        this.lastWithdrawalDate = lastWithdrawalDate;
    }
    public boolean isOnline() {
        return online;
    }
    public void setOnline(boolean online) {
        this.online = online;
    }
}
Ahora creamos un Marshaller y un Unmarshaller genéricos:
import java.io.File;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
public class Marshaller<T> {
    private Class<T> clazz;
    public Marshaller(Class<T> clazz) {
        this.clazz = clazz;
    }
    public void marshall(String xmlPath, T object) {
        JAXBContext context;
        try {
            File xml = new File(xmlPath);
            context = JAXBContext.newInstance(clazz);
            javax.xml.bind.Marshaller marshaller = context.createMarshaller();
            marshaller.setProperty(javax.xml.bind.Marshaller.JAXB_FORMATTED_OUTPUT, true);
            marshaller.marshal(object, xml);
        } catch(JAXBException e) {
            e.printStackTrace();
        }
    }
}
El método marshall convierte un objeto a XML y lo envía a un stream de salida (OutputStream). Si lo envías al stream System.out, el XML se imprimirá en consola; si lo envías al stream File, se persiste en el disco duro.
import java.io.File;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
public class Unmarshaller<T> {
    private Class<T> clazz;
    public Unmarshaller(Class<T> clazz) {
        this.clazz = clazz;
    }
    @SuppressWarnings("unchecked")
    public T unmarshall(String xmlPath) {
        JAXBContext context;
        javax.xml.bind.Unmarshaller unmarshaller;
        T result = null;
        try  {
            File xml = new File(xmlPath);
            context = JAXBContext.newInstance(clazz.getClass());
            unmarshaller = context.createUnmarshaller();
            result = (T) unmarshaller.unmarshal(xml);
        } catch(JAXBException e) {
            e.printStackTrace();
        }
        return result;
    }
}
Y cargas los XML así:
public static void main(String[] args) {
    Unmarshaller<User> unmarshaller = new Unmarshaller<>(User.class);
    // args[0] contiene la ruta del archivo abierto
    User user = unmarshaller.unmarshall(args[0]);
    // imprime 'Pepito Pérez'
    System.out.printf("Nombre:\t%s\n", user.getName());
}
Ahora ya puedes trabajar el XML como objeto.
Edit
Al ver tu comentario en la respuesta de @cloudman, me he dado cuenta que no necesitas esto. Lo que tu deseas es asociar un determinado tipo de archivo a tu programa, y eso creo depende del SO. Quizás este artículo de Microsoft te pueda ayudar: https://support.microsoft.com/es-es/kb/307859
Edit 2
Solo he encontrado esta forma:
- 
Asocias una extensión a un tipo de archivo:
assoc .xml=XML
 
- 
Asocias el tipo de archivo XML a la JVM:
ftype XML=C:\Program Files\Java\jre1.8.0_60\bin\javaw.exe %*
 
Más información: http://www.rgagnon.com/javadetails/java-0592.html