using System.Collections.Generic;
public static void Main()
DateTime fecha = DateTime.Today;
Console.WriteLine("{0}", fecha.ToString("d"));
OrdenCompra c = new OrdenCompra();
XDocument doc = XDocument.Load(@".\" + c.Ocompra);
var data = from n in doc.Descendants("Address")
where (string)n.Attribute("Type") == "Barrio"
nombre = n.Element("Name").Value,
calle = n.Element("Street").Value
Console.WriteLine(d.nombre);
Console.WriteLine(d.calle);
private string ocompra = "PurchaseOrder.xml";
get{return this.ocompra;}
File.WriteAllText(@".\" + this.Ocompra ,@"<?xml version='1.0'?>
<PurchaseOrder PurchaseOrderNumber='99503' OrderDate='1999-10-20'>
<Address Type='Shipping'>
<Street>123 Maple Street</Street>
<Street>8 Oak Avenue</Street>
<Street>Col. 3 de Mayo</Street>
<Country>Honduras</Country>
<DeliveryNotes>Please leave packages in shed by driveway.</DeliveryNotes>
<Item PartNumber='872-AA'>
<ProductName>Lawnmower</ProductName>
<USPrice>148.95</USPrice>
<Comment>Confirm this is electric</Comment>
<Item PartNumber='926-AA'>
<ProductName>Baby Monitor</ProductName>
<ShipDate>1999-05-21</ShipDate>