Index: rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java
===================================================================
--- rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java	(revision 16950)
+++ rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBSchemaInitializer.java	(working copy)
@@ -26,13 +26,20 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Iterator;
+import java.util.List;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlList;
+import javax.xml.bind.annotation.XmlType;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import javax.xml.namespace.QName;
@@ -368,7 +375,7 @@
         MessagePartInfo part = fault.getMessageParts().get(0); 
         Class<?> cls = part.getTypeClass();
         Class<?> cl2 = (Class)fault.getProperty(Class.class.getName());
-        if (cls != cl2) {            
+        if (cls != cl2) {
             QName name = (QName)fault.getProperty("elementName");
             part.setElementQName(name);           
             JAXBBeanInfo beanInfo = getBeanInfo(cls);
@@ -427,6 +434,8 @@
             XmlSchemaSequence seq = new XmlSchemaSequence();
             ct.setParticle(seq);
                 
+            List<XmlSchemaElement> elementList = new ArrayList<XmlSchemaElement>();
+
             Method methods[] = cls.getMethods();
             for (Method m : methods) {
                 if (m.getName().startsWith("get")
@@ -454,15 +463,32 @@
                             el.setSchemaTypeName(typeName);
                         }
                         
-                        seq.getItems().add(el);
+                        elementList.add(el);
                     } catch (Exception e) {
                         //not mappable
                     }
                 }
             }
+            XmlType xmlTypeAnno = cls.getAnnotation(XmlType.class);
+            String[] propertyOrder = null;
+
+            if (xmlTypeAnno != null &&  xmlTypeAnno.propOrder().length > 0) {
+                propertyOrder = xmlTypeAnno.propOrder();
+                //TODO: handle @XmlAccessOrder
+            }
+
+            if (propertyOrder != null && propertyOrder.length == elementList.size()) {
+                sortItems(elementList, propertyOrder);
+            } else if (propertyOrder != null && propertyOrder.length != elementList.size()) {
+                LOG.log(Level.WARNING, "propOrder in @XmlType doesn't define all schema elements: " 
+                    + Arrays.toString(propertyOrder));
+            }
+
+            for (XmlSchemaElement elem : elementList) {
+                seq.getItems().add(elem);
+            }
         }
     }
-
     
     private void buildExceptionType(MessagePartInfo part, Class<?> cls) {
         SchemaInfo schemaInfo = null;
@@ -472,6 +498,14 @@
                 break;
             }
         }
+        XmlType xmlTypeAnno = cls.getAnnotation(XmlType.class);
+        String[] propertyOrder = null;
+
+        if (xmlTypeAnno != null &&  xmlTypeAnno.propOrder().length > 0) {
+            propertyOrder = xmlTypeAnno.propOrder();
+            //TODO: handle @XmlAccessOrder
+        }
+
         XmlSchema schema;
         if (schemaInfo == null) {
             schema = schemas.newXmlSchemaInCollection(part.getElementQName().getNamespaceURI());
@@ -523,6 +557,7 @@
         }
         XmlAccessType accessType = accessorType != null ? accessorType.value() : XmlAccessType.PUBLIC_MEMBER;
 
+        List<XmlSchemaElement> elementList = new ArrayList<XmlSchemaElement>();
         
         for (Field f : cls.getDeclaredFields()) {
             if (JAXBContextInitializer.isFieldAccepted(f, accessType)) {
@@ -530,7 +565,7 @@
                 Type type = f.getGenericType();
                 JAXBBeanInfo beanInfo = getBeanInfo(type);
                 if (beanInfo != null) {
-                    addElement(seq, beanInfo, new QName(namespace, f.getName()), isArray(type));
+                    addElement(elementList, beanInfo, new QName(namespace, f.getName()), isArray(type));
                 }                
             }
         }
@@ -543,10 +578,22 @@
                     int idx = m.getName().startsWith("get") ? 3 : 2;
                     String name = m.getName().substring(idx);
                     name = Character.toLowerCase(name.charAt(0)) + name.substring(1);
-                    addElement(seq, beanInfo, new QName(namespace, name), isArray(type));
+                    addElement(elementList, beanInfo, new QName(namespace, name), isArray(type));
                 }                
             }
         }
+
+        if (propertyOrder != null && propertyOrder.length == elementList.size()) {
+            sortItems(elementList, propertyOrder);
+        } else if (propertyOrder != null && propertyOrder.length != elementList.size()) {
+            LOG.log(Level.WARNING, "propOrder in @XmlType doesn't define all schema elements: " 
+                + Arrays.toString(propertyOrder));
+        }
+
+        for (XmlSchemaElement elem : elementList) {
+            seq.getItems().add(elem);
+        }
+
         part.setProperty(JAXBDataBinding.class.getName() + ".CUSTOM_EXCEPTION", Boolean.TRUE);
     }
     
@@ -561,7 +608,7 @@
         return false;
     }
 
-    public void addElement(XmlSchemaSequence seq, JAXBBeanInfo beanInfo,
+    public void addElement(List<XmlSchemaElement> elementList, JAXBBeanInfo beanInfo,
                            QName name, boolean isArray) {    
         XmlSchemaElement el = new XmlSchemaElement();
         el.setName(name.getLocalPart());
@@ -591,7 +638,7 @@
             el.setSchemaTypeName(typeName);
         }
         
-        seq.getItems().add(el);
+        elementList.add(el);
     }
     
     
@@ -609,4 +656,16 @@
         }
         return isExist;
     }
+    
+    private void sortItems(List<XmlSchemaElement> elementList, String[] propOrder) {
+        final List<String> propList = Arrays.asList(propOrder);
+
+        Collections.sort(elementList, new Comparator<XmlSchemaElement>() {
+            public int compare(XmlSchemaElement el1, XmlSchemaElement el2) {
+                int index1 = propList.indexOf(el1.getName());
+                int index2 = propList.indexOf(el2.getName());
+                return index1 - index2;
+            }
+        });
+    }
 }
