diff --git a/src/core/peptidematch.cpp b/src/core/peptidematch.cpp
index ab3a9377b13ec4e4d985d7a167aa937e1f3a85a3..4e51d36a7c560f49d4c584444ce8dfe00ec37ab5 100644
--- a/src/core/peptidematch.cpp
+++ b/src/core/peptidematch.cpp
@@ -76,6 +76,9 @@ const QVariant PeptideMatch::getParam(PeptideMatchParam param) const {
         return QVariant();
     }
 }
+const std::map<PeptideMatchParam, QVariant> & PeptideMatch::getParamList() const {
+    return _params;
+}
 
 std::size_t PeptideMatch::getHashPeptideMassSample() const {
     return PeptideMatch::_hash_fn (QString("%1 %2").arg(_peptide_sp.get()->toAbsoluteString()).arg(_msrunid_sp->getXmlId()).toStdString());
diff --git a/src/core/peptidematch.h b/src/core/peptidematch.h
index 0c5ccf6a04c9f51acc75d919e83e46d16ff1e824..1da789cd2c41e19a1e8d46c2d499e2222f5bb084 100644
--- a/src/core/peptidematch.h
+++ b/src/core/peptidematch.h
@@ -66,6 +66,8 @@ public :
     /** \brief get specific parameter value
      */
     virtual const QVariant getParam(PeptideMatchParam param) const;
+    
+    const std::map<PeptideMatchParam, QVariant> & getParamList() const;
 
 
     /** @brief set start position of this peptide inside the protein sequence
diff --git a/src/output/xpip.cpp b/src/output/xpip.cpp
index 20f9077c2a24162bd56628e3bf7f3a804b588180..0e7df072d9e1038698f75c2617275f798cf53619 100644
--- a/src/output/xpip.cpp
+++ b/src/output/xpip.cpp
@@ -233,14 +233,20 @@ void Xpip::writeProteinList() {
         _output_stream->writeStartElement("protein");
         _output_stream->writeAttribute("acc",p_protein->getAccession());
         _output_stream->writeAttribute("description",p_protein->getDescription());
-        _output_stream->writeAttribute("is_decoy","false");
+
         if (p_protein->isDecoy()) {
             _output_stream->writeAttribute("is_decoy","true");
         }
-        _output_stream->writeAttribute("is_contaminant","false");
+        else {
+            _output_stream->writeAttribute("is_decoy","false");
+        }
+
         if (p_protein->isContaminant()) {
             _output_stream->writeAttribute("is_contaminant","true");
         }
+        else {
+            _output_stream->writeAttribute("is_contaminant","false");
+        }
 
         _output_stream->writeStartElement("sequence");
         _output_stream->writeCharacters(p_protein->getSequence());
@@ -362,8 +368,54 @@ void Xpip::writeIdentificationGroup(const IdentificationGroup * p_identification
         //std::vector<ProteinMatch *> & getProteinMatchList()
         _output_stream->writeStartElement("protein_match");
         _output_stream->writeAttribute("acc", p_protein_match->getProteinXtpSp().get()->getAccession());
+        if (p_protein_match->isChecked()) {
+            _output_stream->writeAttribute("checked","true");
+        }
+        else {
+            _output_stream->writeAttribute("checked","false");
+        }
+        for (const PeptideMatch * p_peptide_match : p_protein_match->getPeptideMatchList()) {
+            writePeptideMatch(p_peptide_match);
+        }
         _output_stream->writeEndElement();// protein_match
     }
     _output_stream->writeEndElement(); //protein_match_list
     qDebug() << "Xpip::writeIdentificationGroup end";
 }
+
+void Xpip::writePeptideMatch(const PeptideMatch * p_peptide_match) {
+    qDebug() << "Xpip::writePeptideMatch begin";
+    _output_stream->writeStartElement("peptide_match");
+    _output_stream->writeAttribute("source_id",p_peptide_match->getIdentificationDataSource()->getXmlId());
+    //_output_stream->writeAttribute("ms_id",p_peptide_match->getMsRunP()->getXmlId());
+    _output_stream->writeAttribute("peptide_id",_map_peptides.at( p_peptide_match->getPeptideXtpSp().get()));
+    _output_stream->writeAttribute("scan",QString("%1").arg(p_peptide_match->getScan()));
+    writeDoubleAttribute("rt",p_peptide_match->getRetentionTime());
+    writeDoubleAttribute("evalue",p_peptide_match->getEvalue());
+    writeDoubleAttribute("exp_mass",p_peptide_match->getExperimentalMass());
+    _output_stream->writeAttribute("start",QString("%1").arg(p_peptide_match->getStart()));
+    _output_stream->writeAttribute("charge",QString("%1").arg(p_peptide_match->getCharge()));
+
+    if (p_peptide_match->isChecked()) {
+        _output_stream->writeAttribute("checked","true");
+    }
+    else {
+        _output_stream->writeAttribute("checked","false");
+    }
+
+    const std::map<PeptideMatchParam, QVariant> & params = p_peptide_match->getParamList();
+
+    //if (params.size() > 0) {
+    //   _output_stream->writeStartElement("stats");
+    for (const std::pair<PeptideMatchParam, QVariant> param_pair: params) {
+        _output_stream->writeStartElement("param");
+        _output_stream->writeAttribute("key",QString("%1").arg(static_cast<std::int8_t>(param_pair.first)));
+        _output_stream->writeAttribute("value",param_pair.second.toString());
+        _output_stream->writeEndElement();
+    }
+    //   _output_stream->writeEndElement();
+    //}
+
+    _output_stream->writeEndElement(); //protein_match_list
+    qDebug() << "Xpip::writePeptideMatch end";
+}
diff --git a/src/output/xpip.h b/src/output/xpip.h
index 2775fb89b2a5a5b393e52061cab7039304e41ae1..ec52fb03f88a5dd7b96bf2b240d3c10ff56639bc 100644
--- a/src/output/xpip.h
+++ b/src/output/xpip.h
@@ -59,6 +59,7 @@ private :
     void writeLabelingMethod();
     void writeIdentificationGroupList();
     void writeIdentificationGroup(const IdentificationGroup * p_identification_group);
+    void writePeptideMatch(const PeptideMatch * p_peptide_match);
 
     QString getPeptideId(std::size_t crc_peptide) const;
 
diff --git a/src/utils/types.h b/src/utils/types.h
index 68c5507b7217b4bc81cde01515ffbea26ea61903..116c3b0f2f97467bd333479ee91cd411270ef21a 100644
--- a/src/utils/types.h
+++ b/src/utils/types.h
@@ -53,8 +53,8 @@ enum class IdentificationEngine: std::int8_t {
 /** \def PeptideMatchParam peptide match specific parameters
  *
  */
-enum class PeptideMatchParam {
-    tandem_hyperscore ///< X!Tandem hyperscore
+enum class PeptideMatchParam: std::int8_t {
+    tandem_hyperscore=0 ///< X!Tandem hyperscore
 };
 
 /** \def IdentificationEngineParam identification engine parameters