reading from an .xml file and manipulating read

Hello.

I am trying to write code that separates specific items from within the .xml file this .xml file. Ive got the file to open from the console but I am still unclear is to how to eliminate and break how the printout is from the file. eliminate I mean not print to screen and by break i mean how to print the results on multiple lines, not one long line from the file.
here is the .xml file.
<address_book><contact><name>George Clooney</name><street>1042 El Camino Real</street><city>Beverly Hills</city><state>CA</state><zip>90214</zip></contact><contact><name>Cathy Pearl</name><street>405 A St.</street><city>Palmdale</city><state>CA</state><zip>93352</zip></contact><contact><name>Paris Hilton</name><street>200 S. Elm St.</street><city>Beverly Hills</city><state>CA</state><zip>90212</zip></contact><contact><name>Wendy Jones</name><street>982 Boundary Ave.</street><city>Palmdale</city><state>CA</state><zip>93354</zip></contact></address_book>
My logic for getting the info out is off this mess:
-while reading from file read the stuff in <> and </> out of the print
by setting them to string start=<> end=</>
I am also still unclear whether when to use type char or type string and whats the difference.
Here is just some code to see the printout:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdlib>
#include <string>

using namespace std;


void searching_file(ifstream& fin);

string start, end;

int main()
{
    ifstream fin;

    fin.open("address.xml",ios::in);

    if(fin.fail())
    {
        system("color 48");
        cout << "\aERROR! Please check if file is present or exists.\n";
        system("pause");
        exit(1);
    }

    searching_file(fin);

    return 0;
}

void searching_file(ifstream& fin)
{
    string next;

    while (fin >> next)

    cout << next;
}

Any help is appreciated thanks
Topic archived. No new replies allowed.