# Which xml parse method?

**URL:** <https://forum.kirupa.com/t/which-xml-parse-method/253284>\
**Category:** Uncategorized\
**Created:** [February 28, 2008, 9:38pm UTC](https://forum.kirupa.com/t/which-xml-parse-method/253284 "2008-02-28T21:38:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![petermdenton](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@petermdenton](https://forum.kirupa.com/u/petermdenton)\
**Post date:** [February 28, 2008, 9:38pm UTC](https://forum.kirupa.com/t/which-xml-parse-method/253284/1 "2008-02-28T21:38:45Z")

</div>

Hello,

if you had some xml like the example below, coming from a remote file, say [mail.google.com](http://mail.google.com), what is a quick parse script in php to list out all of my contacts?

Name, Email\<br /\> for each item listed, so that its just a long list of names and emails.

I dont know how to parse the \<contact\> as it has the 2 parts, name and email.

```auto

[COLOR=#0000ff]<?xml version="1.0" encoding="UTF-8" ?>[/COLOR] 
[**[FONT=Courier New][COLOR=#ff0000]-[/COLOR][/FONT]**](https://api.rapleaf.com/v2/abook/?login=petermdenton@gmail.com&password=neversayne&api_key=37433dd67a4ccfaa79b12272b116b2a3#) [COLOR=#0000ff]<[/COLOR][COLOR=#990000]contacts[/COLOR][COLOR=#0000ff]>[/COLOR]
**[FONT=Courier New][COLOR=#ff0000] [/COLOR][/FONT]** [COLOR=#0000ff]<[/COLOR][COLOR=#990000]contact[/COLOR] [COLOR=#990000]name[/COLOR][COLOR=#0000ff]="name[/COLOR][COLOR=#0000ff]"[/COLOR][COLOR=#990000] email[/COLOR][COLOR=#0000ff]="example[/COLOR] **@mobile.mycingular.com** [COLOR=#0000ff]" />[/COLOR] 

**[FONT=Courier New][COLOR=#ff0000] [/COLOR][/FONT]** [COLOR=#0000ff]<[/COLOR][COLOR=#990000]contact[/COLOR] [COLOR=#990000]name[/COLOR][COLOR=#0000ff]="[/COLOR] **a.lehnig** [COLOR=#0000ff]"[/COLOR][COLOR=#990000] email[/COLOR][COLOR=#0000ff]="example[/COLOR] **@hotmail.com** [COLOR=#0000ff]" />[/COLOR] 
 

```
