Cómo obtener el elemento de un archivo xml no válido con una validación xsd fallida

Actualmente estoy usando mi XSD para validar mi xml. Esta parte funciona bien, mi problema es que quiero obtener el elemento de la etiqueta / valor que no es válido.

    InputSource is = new InputSource();
    is.setCharacterStream(new StringReader(xml));
    XMLStreamReader reader = null;
    SchemaFactory factory=SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = factory.newSchema(xsdschemalocation);
    Validator validator = schema.newValidator(); 
    try
    {
        reader = XMLInputFactory.newInstance().createXMLStreamReader(new StreamSource(new StringReader(xml)));
    } catch (XMLStreamException ex)
    {
        LogController.getLogger().logSEVERE("Unable to create the streamreader from the xml source", ex.getLocalizedMessage());
        return false;
    }
    try
    {
        validator.validate(new StAXSource(reader));
    }
    catch (IOException ex)
    {
        LogController.getLogger().logSEVERE("IOException in the validatation has been caused as the reader has become null", ex.getLocalizedMessage());
        return false;
    }
catch(SAXException saxe)
    {
        LogController.getLogger().logWARNING("Their is a validation error with the xml", saxe.getLocalizedMessage());
        //*****HERE I WANT THE TAG THAT HAS THE ERROR
        ClientCommunication.ErrorMessageForClient(VALIDATION_ERROR, socket);
        CloseClientConnection();
        return;
    }

La idea que tuve, que no es práctica, es buscar en el mensaje la palabra "tipo" o "etiqueta final" y obtener el valor después de eso, sin embargo, sé que esto no será una buena práctica. Me parece frustrante, ya que puedo ver la etiqueta que no es válida pero no puedo controlarla.

Aquí hay algunos ejemplos del elemento que quiero.

1. Message: Element type "first" must be followed by either attribute specifications, ">" or "/>".

2. javax.xml.stream.XMLStreamException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 353; cvc-pattern-valid: Value '079e989989' is not facet-valid with respect to pattern '([0-9])+' for type 'phoneNumber'.

3. Message: The element type "firstLine" must be terminated by the matching end-tag "</firstLine>".

Respuestas a la pregunta(2)

Su respuesta a la pregunta