Reformat XML text lines on the command line for easy reading with the free Swiss File Knife for Windows, Mac OS X and Linux.

sfk ... +xmlform[3]
sfk xmlform in.xml

simple XML text reformatter to allow easy reading
and searching of XML data.

this command is experimental and may not be suitable
to reformat XML data intended for further processing,
as lines longer than 3900 characters may be hard wrapped!
furthermore output of multi line tags may contain
wrong indentation in some cases.

options
  -i         read text from stdin.
  -indent=3  or typing "sfk xmlform3" selects an
             indent of 3 instead of the default 2.

aliases
  sfk xf        same as xmlform

see also
  sfk jsonform  reformat JSON data

web reference
   http://stahlworks.com/sfk-xmlform

examples
  sfk xmlform in.xml
    read the file in.xml and print it reformatted

  sfk xmlform in.xml +view
    display in.xml reformatted in Depeche View
    to allow easy browsing and searching

  sfk filter in.xml +xmlform
    reformat output of a previous sfk command

  type in.xml | sfk xmlform -i
    reformat output of a non-sfk command

  sfk xex in.xml "x<web_info>**</web_info>x[part2]x"
   +xmlform +view
    extract a web_info multi line text block,
    reformat and display it in Depeche View. [22]
    this uses 'x' as a separator character as '/'
    and '_' are already part of the search text.

  sfk web http://myserver/getxml.php +xf
    call a web URL that sends an xml reply
    and reformat output for easy reading.
 
example command:

   sfk filter in.xml +xmlform

example output:

<?xml version="1.0" encoding="UTF-8" ?>
<XML_DIZ_INFO>
    <Program_Name>Depeche View Lite</Program_Name>
    <Program_Version>1.6.3</Program_Version>
    <Program_Release_Month>01</Program_Release_Month>
    <Program_Release_Day>08</Program_Release_Day>
    <Program_Release_Year>2015</Program_Release_Year>
    <Program_Cost_Dollars />
    <Program_Cost_Other_Code>USD</Program_Cost_Other_Code>
    <Program_Cost_Other />
    <Program_Type>Freeware</Program_Type>
    <Program_Release_Status>Minor Update</Program_Release_Status>
    <Program_Install_Support>No Install Support</Program_Install_Support>
    <Program_OS_Support>Linux,Mac OS X,Win7 x32,Win7 x64,Win98,WinVista,
    <Program_Language>English</Program_Language>
    <Program_Change_Info>Added command line options to search instantly
    <Program_Specific_Category>Utilities</Program_Specific_Category>
    <Program_Category_Class>System Utilities::Text/Document Editors
    <Program_System_Requirements>Windows: none. Linux/Mac: WINE 1.4.1
    <File_Info>
      <File_Size_Bytes>2220032</File_Size_Bytes>
      <File_Size_K>2168</File_Size_K>
      <File_Size_MB>2.12</File_Size_MB>
    </File_Info>
    <Expire_Info>
      <Has_Expire_Info>N</Has_Expire_Info>
      <Expire_Count />
      <Expire_Based_On />
      <Expire_Other_Info />
      <Expire_Month />
      <Expire_Day />
      <Expire_Year />
    </Expire_Info>
  </Program_Info>
  <Program_Descriptions>
      <English>
        <Keywords>fast text browser, text file viewer, full text search
        <Char_Desc_45>Load, view and search all text of a directory
        <Char_Desc_80>Load, view and search all text of a directory
        <Char_Desc_250>Load, view and search all text of a directory
        <Char_Desc_450>Load, view and search all text of a directory
        <Char_Desc_2000>Load, view and search all text of a directory
        </Char_Desc_2000>
      </English>
  </Program_Descriptions>
</XML_DIZ_INFO>