I have three node types: without categories, with a single category and multiple categories:
<technology>
  <categories>
    <category></category>
  </categories>
  <name></name>
</technologie>    
<technology>
  <name></name>
</technologie>    
<technology>
  <categories>
    <category></category>
    <category></category>
    <category></category>
  </categories>
  <name></name>
</technologie>
I want to write data from  technology  node like:
- if there is a single category - write it,
 - if there is no category - write an empty line
 - if there are multiple categories - write the first one.
 
I tried //technology/categories/category[1] - it works, but partly. It fails on writing empty line in case category doesn't exist and writes all existing categories one after one.
Give me please a hint, how to write data in the outlined order.
The formula i use is:
=Dump(XPathOnUrl("https://api.builtwith.com/v12/api.xml?KEY=XXX&LOOKUP="&A2;"//technology/categories/category[1]";;;"text"))
PS: =IFERROR doesn't help too...
      
    
