Index: src/lib/com/izforge/izpack/adaptator/impl/LineNumberFilter.java
===================================================================
--- src/lib/com/izforge/izpack/adaptator/impl/LineNumberFilter.java	(revision 1700)
+++ src/lib/com/izforge/izpack/adaptator/impl/LineNumberFilter.java	(working copy)
@@ -64,6 +64,16 @@
     }
 
     /**
+     * Return the locator on the current position.
+     *
+     * @return the current locator.
+     */
+    public Locator getDocumentLocator()
+    {
+        return locator;
+    }
+
+    /**
      * Return the first element found from the given Node.
      *
      * @param elt The Node start point.
Index: src/lib/com/izforge/izpack/adaptator/impl/XMLParser.java
===================================================================
--- src/lib/com/izforge/izpack/adaptator/impl/XMLParser.java	(revision 1700)
+++ src/lib/com/izforge/izpack/adaptator/impl/XMLParser.java	(working copy)
@@ -25,24 +25,21 @@
 
 import com.izforge.izpack.adaptator.IXMLElement;
 import com.izforge.izpack.adaptator.IXMLParser;
+import com.izforge.izpack.adaptator.XMLException;
 import org.w3c.dom.Node;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
+import org.xml.sax.*;
 
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParserFactory;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.*;
 import javax.xml.transform.dom.DOMResult;
 import javax.xml.transform.sax.SAXSource;
 import javax.xml.transform.stream.StreamSource;
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
+import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 
 /**
  * @author Anthonin Bonnefoy
@@ -51,7 +48,43 @@
 public class XMLParser implements IXMLParser
 {
 
+    
+    public class ByteBufferInputStream extends InputStream
+    {
+        private final ByteBuffer buf;
+
+        public ByteBufferInputStream(ByteBuffer buf)
+        {
+            this.buf = buf;
+        }
+        
+        @Override
+        public synchronized int read() throws IOException {
+            if (!buf.hasRemaining()) {
+                return -1;
+            }
+            int c = buf.get() & 0xff;
+            return c;
+        }
+
+        @Override
+        public synchronized int read(byte[] bytes, int off, int len) throws IOException {
+            if (!buf.hasRemaining()) {
+                return -1;
+            }
+            len = Math.min(len, buf.remaining());
+            buf.get(bytes, off, len);
+            return len;
+        }
+        
+        @Override
+        public int available() throws IOException {
+            return buf.remaining();
+        }
+    }
+
     private LineNumberFilter filter;
+    private String parsedItem = null;
 
     public XMLParser()
     {
@@ -65,10 +98,10 @@
 
         } catch (ParserConfigurationException e)
         {
-            e.printStackTrace();
+            throw new XMLException(e);
         } catch (SAXException e)
         {
-            e.printStackTrace();
+            throw new XMLException(e);
         }
     }
 
@@ -98,16 +131,34 @@
             filter.applyLN(result);
         } catch (TransformerException e)
         {
-            e.printStackTrace();
+            String extraInfos = null;
+            if (this.parsedItem != null)
+            {
+                extraInfos = " in " + parsedItem;
+            }
+            // we try to get the location of the error.
+            // can't use an ErrorHander here !
+            if (e.getLocator() == null && filter.getDocumentLocator() != null)
+            {
+                Locator locator = filter.getDocumentLocator();
+                extraInfos += " at line " + locator.getLineNumber() + ", column " + locator.getColumnNumber();
+            }
+            if (extraInfos != null) throw new XMLException("Error" + extraInfos + " : " + e.getMessage(), e);
+            throw new XMLException(e);
         } catch (IOException e)
         {
-            e.printStackTrace();
+            throw new XMLException(e);
         }
+        finally
+        {
+            this.parsedItem = null;
+        }
         return result;
     }
 
     public IXMLElement parse(InputStream inputStream)
     {
+        this.parsedItem = null;
         InputSource inputSource = new InputSource(inputStream);
         DOMResult result = parseLineNrFromInputSource(inputSource);
         return searchFirstElement(result);
@@ -115,19 +166,25 @@
 
     public IXMLElement parse(InputStream inputStream, String systemId)
     {
+        this.parsedItem = systemId;
         InputSource inputSource = new InputSource(inputStream);
         inputSource.setSystemId(systemId);
         DOMResult result = parseLineNrFromInputSource(inputSource);
         return searchFirstElement(result);
     }
-    
+
     public IXMLElement parse(String inputString)
     {
-        return parse(new ByteArrayInputStream(inputString.getBytes()));
+        this.parsedItem = null;
+        
+        final ByteBuffer buf = Charset.forName("UTF-8").encode(inputString);
+
+        return parse(new ByteBufferInputStream(buf));
     }
 
     public IXMLElement parse(URL inputURL)
     {
+        this.parsedItem = inputURL.toString();
         InputSource inputSource = new InputSource(inputURL.toExternalForm());
         DOMResult domResult = parseLineNrFromInputSource(inputSource);
         return searchFirstElement(domResult);
