The code below of an overloaded member functions looks bloated:
Qt Code:
  1. void MyClass::writeListToXml(const QList<int> &list, const QString &name)
  2. {
  3. foreach(int i, list) {
  4. xml_writer->writeTextElement(name, QString::number(i));
  5. }
  6. }
  7.  
  8. void MyClass::writeListToXml(const QList<double> &list, const QString &name)
  9. {
  10. foreach(double i, list) {
  11. xml_writer->writeTextElement(name, QString::number(i));
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 
How could i pack them together?

Thanks!