Is this a correct way to store an address in an XML file? If it is, how would I echo it in three lines like an address should be written using PHP. If not what is the correct way? (The file is not complete. I am only interested in the address.)
<store name="Pizza R Us" Store_address="16 Main St Anytown, US 00000">
<items>
<pizzas>
<topping>
<name>Tomato and Cheese</name>
<price>
<small>$6.85</small>
<large>$10.85</large>
</price>
</topping>
</pizzas>
</items>
</store>
In response to storing the address: The recommended way is to not store it as attributes, but you can. It is better to store relevant data in tags rather then as attributes for several reasons. The way you are doing it makes it more difficult to pull out just the street or city for a programmer. It is also harder to read, maintain, and is not as easy to change without breaking existing code.
For more detailed information read the following page. Especially the sections “My Favorite Way” and “Avoid XML Attributes?”
http://www.w3schools.com/xml/xml_attributes.asp