title: get xml data from differents nodes and tags
body: <p>Im trying to insert XML data in a temporary table</p>
  
  <pre><code>DEPARTMENT name="Administration" Revision="" IsRevision="False" Configuration=""&gt;
    &lt;FIELD name="Name" value="Jean" type="char" /&gt;
    &lt;FIELD name="LastName" value="Dupont" type="char" /&gt;
    &lt;FIELD name="EmployeeID" value="5" type="float" /&gt;                  
    &lt;ATTACHED_DOCUMENTS&gt;
      &lt;DOCUMENT FileName="contract.pdf" Directory="D:/Contracts"/&gt;
    &lt;/ATTACHED_DOCUMENTS&gt;
  &lt;/DEPARTMENT&gt;  
  
    insert #t_employee
  (t_department,
   t_name,             
   t_value,    
   t_type)     
  select *  
   from openxml (@doc, 'DEPARTMENT/FIELD')  
   with (t_department varchar(255) '../@name',
      t_name varchar(255) '@name',     
      t_value varchar(255) '@value',    
      t_type varchar(max) '@type'); 
  </code></pre>
  
  <p>This code works.
  But now what I want is to add a column in my table and get the information of the document in the "Attached_documents" tag.</p>
  
  <p>I tried to change the path like this to add it but it didnt work</p>
  
  <pre><code>select *  
   from openxml (@doc, 'DEPARTMENT)  
   with (t_department varchar(255) '@name',
  t_name varchar(255) 'FIELD/@name',     
  t_value varchar(255) 'FIELD/@value',    
  t_type varchar(max) 'FIELD/@type',
  t_document varchar(max) 'ATTACHED_DOCUMENTS/@FileName'); 
  </code></pre>
  
  <p>How can I insert the document info in my table?</p>
  
  <p>Thanks for help</p>