How to validate XML with XSD in Java

After initializing xsd with JAXB Binding on Netbeans, you can use a method like this.
Both JAXB binding and schema are same but as far as i see, JAXB unmarshalling doesn’t validate XML, it just transforms it.

package unmarshallertest;

import java.io.*;
import javax.xml.bind.*;
import javax.xml.validation.*;
import oasis.names.specification.ubl.schema.xsd.invoice_2.*;

public class Main {
public static void main(String[] args) {
[...]