数据库名称为yaopin.dbf
字段名   pinming     danwei    rukushu   danjuhao
       阿莫西林   盒     10      20100603101
       六味地黄   盒     10      20100603101
       正痛片    盒     10      20100703111

怎么样把上面的dbf文件的数据,写成下面xml文件

<?xml version="1.0" encoding="utf-8"?>
<Upload>
<YaoPin>
    <RuKu Type="1">
        <DanJuHao>20100603101</DanJuHao>
        <Record>
            <YaoMing>阿莫西林</YaoMing>
            <DanWei>盒</DanWei>
            <RuKuShu>10</RuKuShu>
        </Record>
        <Record>
                        <YaoMing>六味地黄</YaoMing>
            <DanWei>盒</DanWei>
            <RuKuShu>10</RuKuShu>
        </Record>
        </RuKu>
    <RuKu Type="1">
        <DanJuHao>20100703111</DanJuHao>
        <Record>
                        <YaoMing>正痛片</YaoMing>
            <DanWei>盒</DanWei>
            <RuKuShu>10</RuKuShu>
        </Record>
    </RuKu>
</YaoPin>
</Upload>