try {
File f = new File(getExternalCacheDir().getAbsolutePath()+"my.xml");
OutputStream outPut = new FileOutputStream(f);
XmlSerializer serializer=Xml.newSerializer();
serializer.setOutput(outPut, "utf-8");
serializer.startDocument("utf-8", true);
serializer.startTag(null, "companys");
for(String[] s:taxiCompany)
{
serializer.startTag(null, DBUtil.TAXI_TABLE);
serializer.attribute(null, DBUtil.KEY_PROVINCE, s[0]);
serializer.attribute(null, DBUtil.KEY_CITYNAME, s[1]);
serializer.attribute(null, DBUtil.KEY_NAME, s[2]);
serializer.attribute(null, DBUtil.KEY_TELE, s[3]);
serializer.endTag(null, DBUtil.TAXI_TABLE);
}
serializer.endTag(null, "companys");
serializer.endDocument();
outPut.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}